David Bernstein asks "why the infliction of physical pain on someone, assuming he’s not just a suspect but been convicted of a crime, is considered beyond the bounds of human decency by all respectable sources, but locking that same individual in a cell for the rest of his life is a-ok." I'm not sure I have an entirely sound answer to this question but I think that -- at least to some extent -- the basic point is that torture degrades the torturers. There is a relevant moral difference between pushing a button that somewhere, somehow, kills someone you don't know and strangling someone with your bare hands, viz. that one of these things can be done without emotion. I think it's important that no one should derive pleasure from the punishment of others; therefore, public executions, whipping, and anything else that personalizes the process of punishment should be avoided if possible.
You might ask why I'm assuming that the relevant emotion would be pleasure rather than revulsion. This is because there's a selection effect: if you don't enjoy public executions, you can avoid them; if you don't enjoy whipping people, you can try finding work as a plumber.