Because the states funded and paid the volunteer regiments that came from their local communities during the Civil War. In addition, it gave each state a sense of ownership and pride to say that their state’s regiment was a part of the war. A state could boast that they supplied twenty regiments to the war effort as opposed to ten from another state. The federal government did have Army units that were comprised of regulars. And as a result, these regiments were funded by the federal government.
It would have been up to the federal government to pay the troops if they were regular US Army and it would have diminished the role of the individual states. The way it worked later in the war, the state retained some control of the unit and the volunteer regiments were known by the state they hailed from as opposed to regular troops. For example, J.L. Chamberlain served in the 20th Maine Regiment; whereas a federal regiment would be referred to as the U.S. 1st Cavalry Regiment. It was a small difference, but it gave that particular state a measure of pride to have their name associated with that regiment.
In some volunteer regiments they could, at the beginning of the war, elect their regimental officers based on the votes of the soldiers who comprised the regiment. Having friends in the National Guard in the present times, this seems rather funny that you could select your commander. The process of selecting a commander could also be heavily influenced by the governor of their state. Once the regiment was full, it would then present itself to the federal government for employment in the battlefield.
As time went on the job of selecting the commanding officer shifted to the federal government and superior officers, but for political purposes, the states retained some influence on who the next regimental leader would be.