Like most complex things, there’s no one magical simple answer.
States rights was a huge deal from day one, to the point that the mostly forgotten original government of the United States was a confederation of nominally sovereign states, almost EU style. Under the Articles of Confederation, the US government was very weak.
Slavery was essential to southern land barons. It was not essential to northern industrialists, who were better off with immigrant labor. The issue at the end of the day is that Southern wealth was largely defined by chattel slaves - they were the human equivalent of industrial equipment. End of the day, it was about amoral consideration of preserving wealth above all else. (A lesson for any era certainly)
The problem was that the writing was on the wall - machines would replace slaves. But the owners of these big slave estates needed the political power to keep it going long enough to pivot to something new — the vision as I understand it was to build the west with slavery and realize imperialist visions with slavery in Latin America.
Wrapping this craven nonsense in high minded ideals was key for support and to get soldiers. Johnny Reb wasn’t dying for his slaves, for the most part these guys were victims of slavery in a sense as well as the wages for working class people were suppressed by enslaved people.
It’s important to fight lost cause bullshit. But the path to victory is rejecting the notion of slavery attacking the moral failure of slavery and association with it. Bikeshedding over trivia is like arguing with gun nerds over the nuances of firearms.