The death penalty has always been an ideal concept for both a punishment and a deterrent. Since the days of Hammurabi, an eye for an eye. And if everyone were afraid of dying, and they could predict with 100% accuracy the consequences of their actions, then it would be (or, just make the person more determined not to get caught or convicted)! Oh, but the world is not so simple.
Sadly, the flaws of the death penalty that many people reference are flaws of the adversarial system, we talk of mistakes and incompetence, rehabilitation (which for some works and for some doesn't) and morals. The death penalty causes us to ask ourselves what is right and moral and what is just. What would justice demand? Then are our choices of action really justice?
Personally, I think that the death penalty offers a sense of finality to those who have been victimized, and the public in general. People want to feel certain and secure in the fact that Ted Bundy won't be anywhere near their daughters anymore, and that anyone like him will face the same fate. Some people suggest that a life in prison is far worse than death. However, when you consider that the death penalty is given to the most heinous of crimes, usually murders (I'm not saying that all murderers should be on death row), the punishment doesn't always fit the crime. You can speak of a life in prison as pretty horrible, but it gives them what they didn't give their victims--they're still living.
It is true that mistakes do happen, and it's everyone's worst nightmare when an innocent man/woman is put to death. However, if properly used, society can use it as an effective deterrant and punishment. But like the fugu chef who prepares the sashimi, we'd better be damned sure we made all the right cuts.