Killing someone is stupid. It won't deter any psychopath and doesn't act as a punishment or rehab. Also unless you could have a perfect judicial system (which is practically impossible without a time machine) you shouldn't have death penalty because innocent people will always be effected.
It would seem taking a human life is acceptable only in self defense. All else would be hypocritical. Also the death penalty is applied far more likely to certain social levels. Often those of higher social status escape such punishment.
In Islam, death penalty exists. But the life of the criminal is in the hands of the family of the person killed. Meaning they can forgive him, or take some money from him and then free him, or insist on his death. Of course this is only for when a person kills another person and no other crime is involved. Other than that, the penalty for major crimes won't be forgiven. After all, a dead person can't come back to life and simply insisting of the death or imprisonment, might do the family of the deceased no good.