Basically, if the point of the incarceration isnt "what is deserved", but "is he cured", then there is no grounds for objecting to even an indefinite incarceration-- so long as it can be shown that the inmate is not yet "cured".
And like I said, that point is bullshit, as evidenced by the fact that justice systems aiming for rehibilitation over punishment don't, as a matter of fact, hand over indefinite sentences except for things like murder. Imprisonment still acts as a punishment, even if that is not its main goal, so of course its maximum length is limited by the nature of the crime itself.
Also, "to rehibilitate" is not the same as "to cure". A rehibilitated criminal was not necessarily (or even likely) ill. He was simply a criminal and no longer is.
The only thing which allows for a discussion on "does the punishment fit the crime" is the concept of retributive punishment-- that we will punish you as far as and no further than your crime deserves.
Now let me introduce you to the concept of "holding back" - that we aim to rehabilitate the perp, but will not inflict on him any more punishment than his crime deserves. That is, we have a goal but will take care not to cross a line while pursuing it. Both you and Lewis are assuming that aiming to rehabilitate means a monomanic obsession on rehabilitation at any price, which is an absurd strawman.