The death penalty is useful, because prosecutors can get thugs to confess in exchange for taking it off the table. They get life in prison, but it saves the possibility of a jury doing the wrong thing and often the killer offers up more information, such as the location of a body.
I go back and forth on the death penalty. Here in Washington State, because of the Green River killer's no death penalty, it is pretty far-fetched that anyone would get it now. (Ladies and gentlemen of the jury, my client only killed 6 people, while the Green River killer killed dozens and gets to live).
The cost (to the state) on actually getting to the death penalty carried out I've heard is more than just keeping the guy in for life (attorney's fees).
I think life in prison is the worst you can do to somebody - solitary, no TV, no books, etc.
However - you do bring up a very good point that the death penalty can bring more cases to be solved (like the Green River Killer). I imagine if we made for swifter sentencings and execution it might be a deterrent - but I wonder how many of these guys think they will get caught in the first place?