Most scholars agree the South had black soldiers, though they disagree on the numbers. Some interesting research is currently taking place on the topic.
We look back today and wonder at their short-sightedness, but we have the wisdom of hindsight. They could not imagine that, 140 years in the future, the black citizens of a unified US could become doctors, lawyers, justices of the Supreme Court, fantastically rich entertainers, the Secretary of State, or the National Security Advisor. And many of them were fighting for a beloved homeland that was being invaded by people of a different culture and different beliefs but no less racism than the whites in the South.