From Pope St. John Paul II’s encyclical Veritatis Splendor (1993):
In this context, appropriate allowance is made both for God’s mercy towards the sinner who converts and for the understanding of human weakness. Such understanding never means compromising and falsifying the standard of good and evil in order to adapt it to particular circumstances. It is quite human for the sinner to acknowledge his weakness and to ask mercy for his failings; what is unacceptable is the attitude of one who makes his own weakness the criterion of the truth about the good, so that he can feel self-justified, without even the need to have recourse to God and his mercy. An attitude of this sort corrupts the morality of society as a whole, since it encourages doubt about the objectivity of the moral law in general and a rejection of the absoluteness of moral prohibitions regarding specific human acts, and it ends up by confusing all judgments about values.
Instead, we should take to heart the message of the Gospel parable of the Pharisee and the tax collector (cf. Lk 18:9-14). The tax collector might possibly have had some justification for the sins he committed, such as to diminish his responsibility. But his prayer does not dwell on such justifications, but rather on his own unworthiness before God’s infinite holiness: “God, be merciful to me a sinner!” (Lk 18:13). The Pharisee, on the other hand, is self-justified, finding some excuse for each of his failings. Here we encounter two different attitudes of the moral conscience of man in every age. The tax collector represents a “repentant” conscience, fully aware of the frailty of its own nature and seeing in its own failings, whatever their subjective justifications, a confirmation of its need for redemption. The Pharisee represents a “self-satisfied” conscience, under the illusion that it is able to observe the law without the help of grace and convinced that it does not need mercy.
— Veritatis Splendor 104