One could argue that punishment and rehabilitation are often the same. For example, if a man rapes a child, and I cut his balls off with a dull, rusty chainsaw, I'd say that he's being punished and rehabilitated at the same time. Not only is he paying the price for his crime, assurances are being made that the perpetrator will never again be able to rape another child.