The post below looks at punishment due a wrongdoer for the harm done to another or to the common good. But what about punishment due a wrongdoer for the moral harm done to himself?
Here is where justice and mercy meet. If a punishment is just, it may be imposed; that's what justice is all about. Mercy, on the other hand, is all about loving compassion. Mercy isn't opposed to justice, but it has a different end in mind -- the good of the other rather than giving to each what is due -- and so it employs different means.
Suppose you have the moral authority to forgive a punishment due me for some wrong I've done. That means, among other things, it isn't strictly necessary that I be punished for the sake of the common good, or for the good of our relationship. Should you forgive?
In terms of justice, the answer is, "It doesn't matter." The punishment would be just, but it's your prerogative to waive it.
In terms of mercy, the answer is, "Yes if it's better for me, and no if it's not."
How can being punished be better for me than not being punished? If it better repairs the harm I've done myself by doing wrong. If punishment causes me to repent, where being forgiven would confirm me in my bad ways, then mercy requires you not forgive my punishment. This is the old "Since I love you, I must kill you" line of reasoning favored by some when arguing against unconditional forgiveness.
What the Gospel should do here, though, is make us consider very carefully whether forgiving a just punishment is better than imposing it (and again, they are both perfectly just). It does this by superimposing charity upon justice (as the Gospel superimposes charity upon all things).
Under justice, neither forgiveness nor imposition of a just punishment is "better" than the other. But mercy, which is an interior act of charity, uses a different scale: the perfection of the other according to the will of God, which can never be opposed to justice. When forgiveness better serves the perfection of the other -- if he will be a better person if forgiven -- then Christian charity commands us to forgive.