Bertrand Russell said this quote

The reformative effect of punishment is a belief that dies hard chiefly I think because it is so satisfying to our sadistic impulses.