I doubt the average soldier was vehemently racist to be honest,
Bruh, the average soldier on both sides was racist. The Confederates exceptionally so; you see it in the journals of even common enlisted men who are, by and large, aware that they are fighting for slavery.
I know we think of it that way, but there were documented black soldiers for the Confederacy there voluntarily.
Black soldiers were not allowed to enlist for the Confederacy until two months before the end of the war. Most claims of Black soldiers on the Confederate side actually end up leading to enslaved men forced to accompany their enslavers or those they were rented out to. The only notable exception I can think of is that of the volunteer militia in New Orleans which included free men of color; this organization was rejected for service by the Confederacy, and is deeply rooted in the French rather than American Southern caste system in any case.
Sometimes people are just protecting their way of life. Slavery is shit, fullest of full stops, but it’s just not going to be true to frame them all as so immoral to presume them all in Hell.
People who willingly fight for the exclusive cause of overthrowing democracy in favor of racist chattel slavery are absolutely burning in hell, should there be such a thing.