I generally don't like looking at the issue of the death penalty from a moral standpoint, because I look at morality as a personal issue. To me, morals apply to individuals, not society. A society can have an overabundance of immoral people, but the society itself cannot be immoral. Therefore, I do not say that it is "wrong" for the government to kill people when they commit a crime. There are several reasons why the government kills people who commit crime:
1) They are reinforcing the power of the state over the citizenry, which is necessary for a society to survive. The government must be more powerful than individuals or else that society is doomed, so execution of individuals who do things that the government has prohibited is a way of saying that you do not have the freedom to do what the government has said you cannot do. They are not punishing that individual, specifically, but rather it is a display of power (not a deterent, mind you). This is simple enough.
2) Of course there is the issue of removing specifically dangerous individuals from society in order that peace and order be maintained, and this is the second reason why I think that it is reasonable for the state to execute criminal citizens.