They didn't go to war to defend the Union, there was no threat to the Union. They went to war for two reasons. Revenge, and to prevent Independence for Southern states.
The south went to war to defend slavery and ended up losing everything.
The South foolishly attacked Ft. Sumter. The Union sent a 18,000 man invasion in response. "Freeing the Slaves" wasn't even on the list when this stuff was happening. That came later.
People who constantly assert that "freeing the slaves" was the reason the Union went to war are just wrong. Factually wrong. When the war started, the Union did not give a flip about freeing the slaves. If that was their goal, they could have started with Maryland. But. They. Didn't.
They went to war to put down an Independence movement, it's as simple as that.
Of course there was an existential threat to the survival of the union. The south set itself up not only to be direct competitors for the resources of the continent but hostile competitors vowed to cheat, steal, and murder to get their way.