The men carrying the muskets on both sides weren't fighting for or against slavery. As is almost always the case in every war, the upper classes had different issues from the men doing the killing and dying.
https://en.wikipedia.org/wiki/128th_Illi...y_Regiment
But it worked both ways....
OTOH, I'm sure the Plantation Owner class was very invested in slavery but they were the leaders, not the soldiers.
https://en.wikipedia.org/wiki/128th_Illi...y_Regiment
Quote:128th Illinois Volunteer Infantry Regiment
Following the Emancipation Proclamation, the regiment suffered 700 desertions.
But it worked both ways....
Quote: A law had been passed by the Confederate States Congress
called the conscript act. A soldier had no right to volunteer and to
choose the branch of service he preferred. He was conscripted.
From this time on till the end of the war, a soldier was simply a machine,
a conscript. It was mighty rough on rebels. We cursed the war, we
cursed Bragg, we cursed the Southern Confederacy. All our pride and
valor had gone, and we were sick of war and the Southern Confederacy.
A law was made by the Confederate States Congress about this time
allowing every person who owned twenty negroes to go home. It gave us
the blues; we wanted twenty negroes. Negro property suddenly became very
valuable, and there was raised the howl of "rich man's war, poor man's
fight." The glory of the war, the glory of the South, the glory and the
pride of our volunteers had no charms for the conscript..
From "Company Aytch" (H) by Sam Watkins. First Tennessee Rgt.
http://www.fullbooks.com/Co-Aytch-1.html
OTOH, I'm sure the Plantation Owner class was very invested in slavery but they were the leaders, not the soldiers.