Both were defending the Union.
Which was split because the south thought there would be more free states added to the union in the western territories and in order to protect their economic interests (trade and slave ownership) they suceeded. Do you see that if the north fought to save the union they were fighting for an end that would eliminate slavery? and they knew of the possibility slavery would end soon with more free states.
Why didn’t lincoln and mcclellen ride down to Richmond and say, we really don’t want to free slaves, ya’ll come home now.