That wasn't the purpose of the war. Here's Lincoln, 1862: "I would save the Union. … If I could save the Union without freeing any slave, I would do it; and if could save it by freeing all the slaves, I would do it."
That only tells us Lincoln's stated values. He doesn't get to dictate the motives of the entire country. I don't think you can legitimately claim that there wasn't a real ideological abolitionist movement, and that many people fought for it.