I'm going to preface my point by admitting that a lot of what I'm about to say is out of assumption and/or hypothetical situations. I'm also going to add that I'm against the death penalty for many reasons and would never advocate for it, but I can imagine hypothetical situations where I'd be for it.
Assumption: There exists a person/s out there who is so far removed from the norm of experiencing empathy/ morality that they cannot be fixed. But is not mentally damaged such that they don't understand how our society works (An example of the type of person I'm thinking of would be Hannible Lecter, who I'm aware is fictional, but as such we are able to know for certain how he views morality and so works as a model for this hypothetical)
This person, such as mentioned above, would have as much emotional issue with killing a person as they would buying a bottle of milk. However they are aware of the nuances of society and how it wants them to behave and so they can pretend to fit in when need be. As we know, it would not matter if I spent 30 years while said person is locked up, treating them as humanely and kindly as you possibly can. If the opportunity presents itself, they will have no issue killing me regardless of my actions because to them there is no distinction between me and say livestock.
I would also argue that they would in no way be happy in prison, and so prison would be a form of torture, especially if they have to be put in straightjackets and the such. Many would argue that's fine as it's a punishment but we're arguing that prison is about being humane, torture is not humane. (This is obviously an assumption given that I can't put myself in their emotional state. I simply know that I would find it to be a form of torture.)
So if they can't be rehabilitated, and keeping them locked up is torture, then why is it humane not to kill them? (Obviously assuming we can prove 100% that this is the case) They are never going to contribute positively to society, if they get out they'll continue to do what they do and being locked up is not much of an existence. If anything it is a prolonged death sentence.
The only reason I post this is that I find it interesting that as a counter balance to the people who believe capital punishment is the bees knees, there are people who seem to find it impossible to think of situations where it's morally ok to kill someone. But then again I struggle to see many things in black and white. I also happen to believe aiding in willful medical suicide (Euthanasia) of terminally suffering patients to be ok (possibly kindness depending on the situation) so my opinion doesn't tend to be popular haha.