Is there something that would prevent society from imprisoning them for as long as needed
Yes, political change could prevent that.
As a more practical matter, remember that you have a wild spectrum of crimes called "murder". At one end, you have some clueless cop restraining an OD while waiting for the ambulance he himself ordered. On the other end, you have the "hi fi murderers" who forced their victims to drink Drano in order to eliminate witnesses of their rape and robbery. To me, a public policy of keeping the same punishment for both crimes will effect the cost-benefit analysis that even flunky criminals are capable of performing. (Sometimes.)
And partly, it's just a matter of vindictiveness. Someone who kills people by forcing them to drink Drano just needs removed from the species.
That's an irrational evil feeling, but then everyone else seems motivated by irrational kumbaya feelings.
The main problem with this thinking—aside from any moral values, and the permanence of wrongful convictions—is who gets to decide on who “deserves” death. This was the reason WA’s supreme court struck down the death penalty in 2018 (read, this bill only reinforced a ban already in place via the justice system), as it ruled that the death penalty—as executed prior to 2018—was inherently a racist penalty. That is the rule in which it was applied, did so seemingly arbitrarily for equal crimes, while still following racial lines.
Your second argument holds no water. CA, which still has the death penalty, is spending way more money on death row prisoners than on prisoners sentenced to life without the possibility of parole.