The civil war was about the Federal Government telling the states what they had to do.
Imagine if the issue was not telling states they had to end slavery, but instead telling them had to.. oh, I dunno.. buy health insurance
What was the Federal Government telling the states they had to do before secession?
No, it was about Deep South Fire Eaters declaring secession, Confederacy and war on the United States, to protect their "peculiar institution" slavery, period.
Initially the Union fought to defend itself against Confederate aggressions, in the course of which freedom for slaves became a huge strategic move, which also fit perfectly with Republican abolitionist ideology.