Yes, with strong evidence and the right crime. Cheaper than solitary confinement and/or a life prison sentence. Totally necessary for some crimes for example; (child molestation and murder), any form of terrorism, mass shootings, serial killing, human trafficking into the sex trade (including abduction) and genocide. There are probably more crimes to note but thats all I can think of right now. I don't believe it is always justified on murder alone, since there are a lot of different cases.
In my view some people have something fundamentally wrong with them and don't deserve the right to live or the tax payer money to keep them alive 'without freedom'. It is not worth anyones time trying to change somebody who clearly has no remorse for their actions, and can theorise and carry out a crime of that magnitude.