There are many forms of punishment, prison is only one of them. The original purpose of prison was to keep dangerous people locked away to keep the public safe. Of course, it has changed over the years and is now seen in some quarters as society getting it's retribution.
Of course, as Mr Turnock is about to find out, the real punishment is what happens inside the prison walls, not the actual confinement itself.