Hopefully, Gwynne's character made a good solution to the problem.

If I were him, I would have:

1. Put him back in "the hole" for awhile...actions have consequences.

2. Forbade the guard played by Nat Polin (The one who joked about the "hooky-dooky") from getting near the prisoner with severe consequences for doing so, if possible.

3. Let the guard played by Ralph Bell check up on the prisoner in "the hole" as frequently as possible.

4. Hoped the prisoner behaved himself so he could get out and not return again.

I believe it would be interesting to see real-life situations of those who are put in solitary confinement while incarcerated. I'm guessing most of them have richly deserved it. But I'm in agreement with you that this should be a means of punishment, not torture. (And I don't think it was, as the prisoner had already been convicted of a crime, and they weren't trying to elicit information from him.)