The two sides involved in the American Civil War were the Union, which represented the North, and the Confederacy, which represented the South. There were numerous reason behind why each side's soldiers fought for one side or the other.
The North and its troops originally fought because they felt the South had no legal right to secede from the Union and was close to treason. As it seemed that the North might lose the war as well as support, ending slavery became the new focus of the war, rallying new support for the North. The South and its soldiers fought for state rights and to defend themselves from the North, but soon the point of slavery became a factor in the South as well, even before it became a rally cry in the North.