Without going into the details of why (a whole other question) the Confederacy formed itself as a voluntary association of sovereign states which joined together for the purpose of protecting their collective rights (implicitly, though not actually stated, the right to keep slaves). In so doing they explicitly rejected Lincoln's claim that in forming the United States the individual States had signed away their sovereignty.
Add to the above ; the south was a primary producer, and the north had a manufacturing base .The north was getting wealthy while the south declined. Slavery was an emotive issue ,but not the main one.