I answer that, As already stated (Article [6]), punishment can be considered in two ways---simply, and as being satisfactory. A satisfactory punishment is, in a way, voluntary. And since those who differ as to the debt of punishment, may be one in will by the union of love, it happens that one who has not sinned, bears willingly the punishment for another: thus even in human affairs we see men take the debts of another upon themselves. If, however, we speak of punishment simply, in respect of its being something penal, it has always a relation to a sin in the one punished. Sometimes this is a relation to actual sin, as when a man is punished by God or man for a sin committed by him. Sometimes it is a relation to original sin: and this, either principally or consequently---principally, the punishment of original sin is that human nature is left to itself, and deprived of original justice: and consequently, all the penalties which result from this defect in human nature.
Nevertheless we must observe that sometimes a thing seems penal, and yet is not so simply. Because punishment is a species of evil, as stated in the FP, Question [48], Article [5]. Now evil is privation of good. And since man's good is manifold, viz. good of the soul, good of the body, and external goods, it happens sometimes that man suffers the loss of a lesser good, that he may profit in a greater good, as when he suffers loss of money for the sake of bodily health, or loss of both of these, for the sake of his soul's health and the glory of God. In such cases the loss is an evil to man, not simply but relatively; wherefore it does not answer to the name of punishment simply, but of medicinal punishment, because a medical man prescribes bitter potions to his patients, that he may restore them to health. And since such like are not punishments properly speaking, they are not referred to sin as their cause, except in a restricted sense: because the very fact that human nature needs a treatment of penal medicines, is due to the corruption of nature which is itself the punishment of original sin. For there was no need, in the state of innocence, for penal exercises in order to make progress in virtue; so that whatever is penal in the exercise of virtue, is reduced to original sin as its cause.