I've always wondered about this myself.
If I was to kill someone and then give myself up, I'd get sent to prison.
If I was to wander down the street waving an unloaded shotgun about, armed police would be called out. They'd tell me to drop the weapon and If I didn't they'd shoot me dead.
So for actually commiting a murder I get prison, but for only behaving as If I might kill someone I get the death sentence, with no trial.
Objections to the death penalty are usually because..
a) Innocent people could die (but in the above example I've done nothing other than behave like an idiot, so this is already happening).
b) It's barbaric for society to kill - but we already do it when it suits us, e.g in the above example, or whenever we drop bombs on a foreign country.
I'm not for or against capital punishment myself, I honestly can't decide. I just find it an interesting debate.