Many murders are not premeditated (planned in advance) so the deterrent argument wouldn't apply to those. Sometimes people get angry and kill people, there's no rationality involved or thought about the consequences. These people could be rehabilitated and eventually released back into society, where they could become law-abiding citizens.
Secondly, if killing is immoral except in situations of self-defence, then it's also immoral to kill a prisoner. It would be hypocritical to kill them.
Thirdly, some people are wrongly convicted of crimes, and some of these people are executed. If we didn't execute people then no innocent people would ever be executed. Let's say we choose not to execute 100 convicted people. At least one of these people is probably innocent. I would rather save the lives of 99 murderers if it meant also saving the life of 1 innocent person.
Lastly, there is absolutely no evidence whatsoever that shows that the death penalty reduces crime. I see it as revenge, not justice.