From a purely economic POV, it makes no sense. Compare the average annual cost per state prison inmate [1] ($22,000 for Texas) to the annual cost of a death row inmate. For example, $90,000 per inmate per year for Nevada [2].
In addition capital cases are significantly more expensive to try. Each Federal execution cost an estimated $1 million [3].
Since 1973, at least 190 people sentenced to death have been exonerated [4]. People exonerated of crimes tend to skew heavily towards minorities, particularly African-American [5][6], which shows it's not really about the severity and certainty of a conviction but instead emotional retribution disproportionately targeted at black people.
The American carceral state is an abject failure and a blight on humanity. We have 4% of the world's population but 25% of the world's priosners. If locking people up worked, this would be the safest country on Earth.
[1]: https://www.vera.org/publications/price-of-prisons-2015-stat...
[2]: https://www.leg.state.nv.us/App/NELIS/REL/76th2011/ExhibitDo...
[3]:https://interrogatingjustice.org/death-sentences/the-cost-of...
[4]: https://deathpenaltyinfo.org/policy-issues/innocence
[5]: https://innocenceproject.org/dna-exonerations-in-the-united-...