Slavery was also legal at that time.

You must mean "ignorant to your narrow comprehension of American history."
Yes, the southern states did want to secede from the union. Part of the reason they wanted to secede was because they felt that the federal government was ignoring state rights. They wanted increased state rights.
Let me put it another way in case you're still confused. The southern states desire for increased state rights led to their desire to secede from the union, which eventually led to war.
I hope this more detailed explanation of my statement has helped you to understand one of the reasons for the Civil War.