I've had to edit this for clarification.
I doubt the average soldier was vehemently racist to be honest, I know we think of it that way, but there were documented black soldiers for the Confederacy there voluntarily and I doubt they were fighting for slavery.
Sometimes people think are just protecting their way of life, fighting for their family, community, and their ideals and idea of loyalty.
Slavery is shit, fullest of full stops, but it's just not going to be true to frame everyone who fights for a nation as so immoral to presume them all in Hell - if this were true then pretty much everyone in the US military would be across all conflicts as the US invites and is often the aggressor for a majority of conflict.