It's less the cost of death vs life imprisonment, more the cost of appeals. Death is permanent, the appeals process is thorough (tragically, not thorough enough) in an effort to ensure that only those who are guilty are killed. Doesn't work very well, thus the moratorium and banning of it in some states when their leaders finally acknowledged the severity of the situation.