The Union leadership was just fine with the slavery based economy of the South. It was paying 75-85% of all the bills for the Federal government, and so as long as they controlled the money, they wanted those slave states producing that money.
Slavery was what the democrats in the south and in the north wanted to protect.
And the money produced by those slaves coming into the pockets of the New York and Washington DC cronies is what the Republicans wanted to protect. Here is a map of the trade revenues to the Federal government. Even though the vast majority of money was collected in New York, the import trade was paid for by about 75-85% of slave produced exports.
See that pile of money on New York? That represented 200 million dollars per year in slave produced trade, and New York and Washington DC both wanted that money to keep flowing into New York and Washington DC.
People have been misled. The war was not about slavery. It was about who was going to control the money that slaves produced. If the war had ended quickly, Washington DC and New York would have kept that slave money coming into the country.
People don't understand what happened because they've been fed bullsh*t about "slavery" for the last 170 years. It was about money. Nobody cared about the slaves until they figured out a way to get political power from them.
The democrat party supported slavery, and still support it in the form of the welfare state.
The Republican Party has always opposed slavery.