"The punishments of the present life are not sought for their own sake, because this is not the time of final retribution; but they are sought insofar as they are medicinal, aiding either the correction of the sinning person, or the good of the republic, whose tranquility is procured by the punishment of people who sin." (ST II-II, q. 68, a. 1)
I didn't understand well why human punishments should only intend the "medicinal" aspect of the penalty. Does St. Thomas Aquinas explain this better elsewhere?