https://en.m.wikipedia.org/wiki/Confederate_States_Army#Morale_and_motivations
Some historians emphasize that Civil War soldiers were driven by political ideology, holding firm beliefs about the importance of liberty, Union, or state rights, or about the need to protect or to destroy slavery. Others point to less overtly political reasons to fight, such as the defense of one's home and family, or the honor and brotherhood to be preserved when fighting alongside other men. Most historians agree that, no matter what he thought about when he went into the war, the experience of combat affected him profoundly and sometimes affected his reasons for continuing to fight.
Now there is also another bit where it acknowledges some were explicitly fighting to defend slavery. However since what those researchers are using is letters....
Only the wealthiest southerners could read and write, and if you were from the South and wealthy, it's a pretty safe bet your family owned slaves.
But the vast amount of southerners were too poor to ever afford slaves. So that greatly skews the sample.
But even the ones who explicitly stated they were fighting to keep slavery legal, the feds and Lincoln were adamant they weren't going to outlaw slavery on a federal level.
So those traitors who said they fought to keep slavery legal, were fighting to prevent something that wasn't going to happen. They just thought it would because the leaders of the Confederacy lied to them about it.
Just like the 1/6 traitors believed the reason they were attempting to overthrow the American government, was because they thought Biden stole an election.
Just because a conservative believes something, doesn't mean it's true.