Keeping such offenders confined for long periods of time in a proper special handling unit serves the same purpose, but with one less death (the offenders).
At least the way the USA does it, for offenders who are 'just that dangerous', it amounts to torture. Also from my studying of the issue, I don't see any real alternatives to keep them from killing guards or other prisoners.
Capital Punishment is less about justice than it is vengeance; I often see a certain harshness in general with many people in the US population when it comes to the penal system that doesn't seem to exist as much elsewhere in the Westernized world
Thus my comments here and elsewhere about how people are actually on record for opposing nitrogen asphyxiation as an execution method because it's 'too good for them'. I'm unusual, I look at the issues differently. On average I want shorter sentences, more concentration on reform and re-integration with society, because our current vengeance system is just too expensive in both terms of money and human life. Our prison system turns a lot of petty criminals into murderers. Most murderers in the USA have 'served time' in prisons. I can't help but think that's linked. It's where somebody with no previous record goes off their rocker and kills that is rare enough to be news. On the other hand, slip over a line, one that I've deliberately tried to avoid defining too tightly, and I'll kill you, or support the state doing the job.
Think of it a bit like triage - go through the line, marking some for immediate surgery, some who can wait, and slipping a hefty dose of morphine to those that can't be saved. I'm unusual - I have no thoughts of vengeance when I call for the death penalty. I view it a lot like putting down a mad dog. Kindest thing for everyone.