The basic answer for this is that the war was not going well and so the Union had a much greater incentive to allow African Americans to fight.
In 1861 and 1862, the North had been losing a lot of battles. Not surprisingly, this reduced the eagerness of white Northerners to volunteer. Meanwhile, many blacks were relatively eager to fight, particularly after the Emancipation Proclamation was issued. This meant that there was a need for more manpower and a potential source of it. Given these circumstances, it was not surprising that the North decided to allow blacks to fight.