Based upon penal statistics, if a man or woman enters prison in his/her thirties and is given a life sentence rather than the death penalty, and lives forty more years with the average cost of $30,000.00 per year for this prisoner, he/she will cost the taxpayers $1,200,000.00 minimum. This estimate does not include others factors such as extreme medical conditions that may require additional expense. Also, if the dangerous criminal is not executed, there is the potential that he/she will kill other inmates and staff while being allowed to continue to live. This fact can easily be researched for its verity: Two infamous examples of heinous criminal murderers are federal prisons with the last name of Silverstein and Fountain.
It can be argued that the death penalty makes sense, especially if there is indisputable evidence. Such cases as that of the infamous John Wayne Gacy and Ted Bundy left no doubt. Also, when an inmate kills a prison staff member and there are witnesses to this murder, there is little reason to allow an inmate the opportunity to kill again. Within the prison, the death penalty for killing a staff member certainly would be a deterrent for most inmates.
There is no way to answer this in an objective fashion. It depends on the principles from which you start and on the effect that you think the death penalty has on society as a whole.
For example, a utilitarian might say that the risk is an acceptable one. Such a person might say that having the death penalty brings a benefit to society that is larger than the negative impact of executing an innocent person every now and then. This view would be based on the idea that it is acceptable to harm a person (even by killing them) if it will bring a benefit to society that outweighs the harm.
By contrast, a Kantian would say that this trade off is not acceptable. If we kill an innocent person just to gain some benefit for society, we are treating that person as a means and not an end. We are simply using that person as a tool. This is not acceptable to someone starting from a Kantian perspective.
So the answer to this depends largely on the first principles which any individual holds.