The basic reason both sides kept fighting is that they each strongly wanted their own way. The North wanted the Union to be kept together while the South wanted to be able to rule themselves, which of course meant that they wanted to be able to have slaves. Behind these abstract ideas were strong currents of stubborness and pride.
Any long war has to have fairly deep roots. In the case of the Civil War, it was the issue of federal control versus states rights. Should the federal government be able to dictate to the states on fundamental issues like slavery or should the states be able to each do what they wanted? The North felt strongly that the Union was sacred while the South felt strongly that they should be able to do what they wanted, regardless of what the federal government said.
But that seems like a pretty feeble excuse for killing, doesn't it? I would argue that any long war also has a lot of pride and stubborness/selfishness behind it. Both sides simply did not want to back down and look bad. They did not want to seem weak by giving in to the other side. In that way, you can really argue that the war was driven by a sort of childish desire to win and to avoid having to give in to someone else.