The South (ie Democrats) were fighting because they refused to accept the results of an election. The North was fighting to preserve the Union.
The North was fighting to preserve the Union. The South was fighting to become Independent of it.
The Declaration of Independence (the founding document of the United States) says the South had a right to leave.
Governments are instituted among Men, deriving their just powers from the consent of the governed,--That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness.