Every real system is some mix of these functions. We don't want to do torture, but we do talk about retribution, a bit. Perfect repair is unattainable, but we do talk a lot about rehabilitation. We don't talk much about removal, but (GP argues) this is in fact a rather large part of what our system is actually designed to do.
It is unattainable because "perfect" is undefined for both the imprisoned and free people.
Arguments involving the idea of achieving perfect rehabilitation are the enemy of the good in this case. It's just as pointless to talk about perfectly repairing prisoners as it is to talk about perfectly repairing any of us. We're all variously damaged goods.
I agree with the GP that the system is designed for removal, but disagree that a system geared towards rehabilitation is impossible, if only by the existence proof provided by the number of people who have been rehabilitated to the point that they are no longer a danger to themselves and society.
I'm not sure what the GP thinks is the value that torture brings to the discussion, at least in societies that presume to operate on a foundation of human rights. Torture is literally psychopathic behavior, itself warranting punishment by removal via imprisonment. And with some notable and terrible exceptions, our laws back that up.
As for torture, in my view, they're simply saying that our goal is not really punitive because we're not actively trying to make prisoners miserable. Our incompetence, uncaringness and willingness to allow prisoners to be taken advantage passively creates misery, though.
No one is suggesting that we should torture anyone, only using it to point out that the prison misery comes more from apathy about prison conditions rather than some active attempt to create misery.
Explicitly mentioning that the purest form of retribution would be torture is (IMO) a way to argue that this ought to be a smaller component of what we do. Being sent to prison by definition involves a loss of some freedoms, it's not going to be pleasant. But exactly how unpleasant, this is at least partly within our control.
Why should it be any component of what we do? You don't have to be religious to recognize the need to call it unacceptable as a basic societal principle.
So you need to define torture, and then find a punishment which you find to not be torture and convince general society that it is both proportional and effective punishment for some specific criminal act.
Wait, the only true punishment is to torture someone, and it is impossible to help someone move away from a life of crime? What system of belief is that derived from, because it doesn't derive from any modern rights-based cultural or legal tradition.
The world is full of examples of people who didn't commit crimes after receiving mild punishment, and were successfully rehabilitated away from crime.