For me, the question can also come to "When is it acceptable (moral, ethical, whatever) for the State to do what I as an individual am forbidden by the State to do?"
Just as a point of interest: if it wasn't for the death penalty, Jesus of Nazareth couldn't have redeemed mankind.