As a result he was sent to prison for some months. But than lots of bad things happen during wars. Racism has little to do with it these days. Racism is a sickness but people don't take the cure by being called names or making them ashamed of their heritage by twisting historical facts to justify ones own views. I have met a few bigots here but very few racists.
Wars are often about conscience and following that illusive voice.
The young men who fought for the Confederacy had no reason to defend slavery. It did very little to make any of their lives better. Most likely that was given very little thought when they went into battle. Defending slavery seems a very stupid reason to fight and die. The Confederate soldier had little or no interest in dying to maintain slavery.