In the movie Gettysburg, the character of Chamberlain makes a statement along the lines of "We're an army fighting to set other men free. That hasn't happened often in the history of the world." Now, without getting in to the details of how close that is to anything Chamberlain ever said, or going in to the how accurate a statement that might be in the American Civil War, it did make me consider a question.
Have there been any historic wars, prior to American Civil War (1861-1865), where either a major motivation, or major result, was the general manumission of slavery in a conquered realm? If so, was this out of some kind of moral imperative ("Slavery is wrong, don't do it!") or more of a punitive action ("You lost the war, so you lose your slaves and suffer the economic harm coming from that fact.")
I checked through the FAQ, and didn't see anything addressing this particular question. I know ascribing motivation can be difficult, especially across centuries, but this seemed like a intriguing topic.
I'm not sure if it fits exactly the kind of scenario you're thinking of, but the Haitian Revolution at the turn of the 19th century was fought primarily by black Haitian slaves and freedmen against their French colonial overlords, with the express purpose of winning their independence and ending slavery on the island.
Assigning motives to complex phenomena that affect entire societies is often difficult, but it's fairly clear at least in this case that the slave majority desired freedom for their own sake, and it's hard to imagine that many who have experienced slavery first hand wouldn't develop a moral opposition to it as well.
From a different perspective, while it did not involve open war in the same sense of the American Civil War, Great Britain outlawed the Atlantic slave trade in 1807 and thereafter set up a naval force which would blockad the west African coast and stop ships attempting to transport enslaved Africans to the new world, freeing and returning them instead. The impetus for the act came primarily from religious factions in Britain who considered slavery gravely immoral.
It's probably better characterized as Britain using the Royal Navy to catch criminals and smugglers who were subverting bans on slave trading that took hold across Europe during the 19th century.
One example that comes to mind is the war between Thebes and Sparta in the aftermath of the Peloponnesian War. The war that the Battle of Leuctra (won by the Theban general Epaminondas) & Battle of Mantinea (note there are multiple battles that took place at these locations. Apparently they're quite strategic/near strategic landmarks, and thus much fought over) were part of.
As you no doubt know, Sparta's power and influence was based on her superb army. And without a slave population of Helots that freed Spartan men from having to work the land, permitting them to train as full time soldiers, the Spartans could not maintain their qualitative military edge.
So after defeating the Spartans at Leuctra, Epaminondas seems to have set out to break Spartan power once and for all. He invades the Peloponnese at the head of a huge army the Spartans cannot hope to match, and frees the Messenian Helots, calculating that this would greatly weaken Sparta, and create a bitter, implacable enemy right on their borders.