What was the north fighting for in the civil war?

Primarily to keep the Union together and not let the States split. The Union (or the North) beleived that the Southern States did not have the right to leave the Union. That point of law has been debated for a long time.