No they didn't. They fought to end Independence for the Southern States. If they were fighting to end slavery, the Emancipation Proclamation would have been issued July 21, 1861 instead of January of 1863.
If "ending slavery" was the reason for the war, why did they wait nearly two years before announcing it? Why did slavery continue in the Union states for long after it was abolished in the Confederate ones?
The American public has been fed a load of crap, and the propaganda has become ingrained in the public mindset.
And what was the issue that the Southern states wanted independence over?