Constitutional Convention of 1787, all states agreed to end importation of slaves. Went into effect in 1808. Prior to 1808 all states had individual laws prohibiting participation in the international slave trade. Constitutional process in action: convention, and sovereign state action. All states unified.
Only thing still in existence at the time of the war was slave ownership, and internal trade, in both the north and south. And even in northern states who had abolished prior to the 13th amendment, the precursor to Jim Crowe laws were in effect, severe racial segregation. Racism in the North against freed slaves, European immigrants ... those who came later.
13th amendment was the first of the Reconstruction acts, but not the last. Again, why did they not pass the 13th with the northern monopoly on the union? After all, to the north, the south was in rebellion (not exercising their constitutionally protected right to secede) so they should've had unanimous support in congress during the war, and it would've been stronger than an executive order like the EC! Fact is, slave ownership was alive and well in the north.
What the south fought in reconstruction was northern enslavement of southern autonomy and resources. But it was too late. Union trumped republic, executive trumped constitution, precedent was set and we've been sliding downhill since.
The war was unnecessary to resolve slavery. But it was necessary to assert the constitutionally protected rights of states, and that cause lost. And were facing the same issue today around firearms, immigration, gay rights and taxes. If the republic loses again, someone will say it was over homosexuality.