CCC 2266 The efforts of the state to curb the spread of behavior harmful to people’s rights and to the basic rules of civil society correspond to the requirement of safeguarding the common good. Legitimate public authority has the right and duty to inflict punishment proportionate to the gravity of the offense. Punishment has the primary aim of redressing the disorder introduced by the offense. When it is willingly accepted by the guilty party, it assumes the value of expiation. Punishment then, in addition to defending public order and protecting people’s safety, has a medicinal purpose: as far as possible, it must contribute to the correction of the guilty party.1
1 Cf. Lk 23:40-43.