"but for murder would be both a punishment and a deterrent"
It's not a deterrent though, is it? Also, in the case of the death penalty it's the innocents who really suffer. Better to keep the buggers alive and let them stew over their mistakes for the rest of their days.