Catechism of the Council of Trent
1077
Part II. Penance
Satisfaction Deters Others From Sin
The Church, therefore, with great wisdom ordained that when anyone had committed a public crime, a public penance should be imposed on him, in order that others, being deterred by fear, might more carefully avoid sin in future. This has sometimes been observed even with regard to secret sins of more than usual gravity.