In the United States today, this is a question of some controversy. In particular, many people in the South are adamant that this was not a war whose aim was to preserve the system of slavery. That said, here is the historical consensus on this question.
For the South, the war was caused by the states’ desire to retain the system of slavery. Southerners now argue that they started the war for states’ rights and not for slavery. However, the only right that they were worried about preserving was the right to hold slaves. When Abraham Lincoln was elected president of the United States without any Southern votes, Southern states started to secede. They were convinced that Lincoln intended to abolish slavery.
For the North, the war was about trying to preserve the Union. Most Northerners were not abolitionists. They did not like slavery and they did not want slavery to spread from where it existed at the time. However, they were not strongly motivated to try to put an end to the institution. What the North really wanted to do was to prevent the country from breaking up.
The argument between the two sections of the country played out as the country expanded. As new territories and states were added, the North and the South came into conflict as to whether those areas would be free or slave. The repeated conflicts increased the two sections’ distrust of one another, and war eventually became inevitable.
At its root, then, the Civil War was caused by the South’s desire to preserve slavery, and the North’s desire to maintain the Union while keeping slavery from spreading outside the South.