You can argue to an extent that imprisonment is not a widely successful deterrent either, but the point is that rehab is taking action AFTER the crime has been committed. That's not a deterrent. It's come too late.
Rehabbing a murderer won't bring justice to the murder victim. Dead is dead. Hoping for the murderer not to murder again with rehab is not solving the problem - again, it's too late. They already killed someone. If the goal with rehab is to keep the "body counts" low, then we're COMPLETELY fucked.
We focus too much on what to do AFTER crimes are committed and have missed the whole fucking point of preventing them from happening in the first place. And considering how large the US prison population is, how the hell are people planning on effectively mass-rehabbing everyone in prison for serious crimes? We have no idea who will "recover" and who will go on to kill again. Every individual killer would need to be closely monitored. It's an impossible task. There's not enough agency to handle a task of that magnitude.
Rehab, education, mental help, economic help, and simply respecting other people's lives needs to be the focus BEFORE crimes happen, to prevent them, to deter them through common sense and consciousness. That's where the effort for saving people should be.
But this country sucks because everyone is reactionary instead of proactive.
I think what people are saying though is that you can both work on changing our societies systems to help prevent this from happening in the first place AND change the system to help prevent those who have caused hurt from not doing it again and possibly being productive in preventing others from doing so. It's not an either or thing.
We have the resources for both, we let these rich assholes in power convince us that we don't though as they horde and lobby to make shit harder for others.