Sometimes persons debate competing understandings of justice. For some justice is about cuique suam, to each what is his due; for others justice is about restoration and rehabilitation. These two perspectives go back and forth and various arguments may be given.
Now for myself I find that attention to merit is an important part of justice. Giving each person what she deserves, whether good or bad -- that is being just. But the other day I had the thought that we might be able to justify the supposition of an intrinsically restorative element of all just proceedings precisely through an attention to merit. We would need the presence: it is a baseline merit of all persons that they deserve to be treated with an eye to their good; they cannot be treated in a manner without any interest or concern in their own well-being. This is what they deserve, and therefore justice as attention to merit may demand a restorative element.
Consider this passage from Gregory of Nyssa, in which he describes the fate of those persons who did not purify themselves of their sins through faith and baptism during their time spent on earth:
But those, on the other hand, who have become inured to passion, and to whom nothing has been applied to cleanse the stain -- neither the sacramental water nor the invocation of divine power, nor the amendment of repentance -- must necessarily find their appropriate place Now just as the appropriate place for debased gold is the furnace, so the evil mingled with these natures may be melted away in order that, after long ages, they may be restored to God in their purity. Since, the, both fire and water have capacity to cleanse, those who have washed off the stain of sin in the sacramental water do not need the other means of purification. But those who have not been initiated into this purification must of necessity be purified by fire (Catechetical Oration 35).
For Gregory, those persons who did not repent of their sins and were not purified by baptism have to receive the end that is appropriate for them. Notice, however, that their appropriate place is one of suffering, yes, but a purificatory suffering. He uses the analogy of purifying gold. It is appropriate that sinners suffer; he doesn't deny that point. But appropriate would be for their suffering to be intrinsically purifying, which is to say that it is done for their own sake and with their own benefit in mind. They are sinners but they are not garbage; they are more akin to impure gold. You don't throw away impure gold, but rather you purify it. Likewise the appropriate treatment of sinners -- one which pays attention to what they deserve -- is one that is intrinsically directed towards their good.
In other words, attention to merit must not limit itself only to merit according to action. There must also be a consideration of the quality and value of the thing as being. Human persons are of such value that it is only ever appropriate to treat them in such a way that does not ignore their own good. We must always have an eye to their good in dealing out justice.
Does this conception of justice leave no room for grace? No, for it is obvious that one could (a) not cause the other person as much harm as they deserve, and likewise could (b) assist in the process of restoration more than the person would deserve, or even (c) restore the person to a higher position than deserved.
Does this conception of justice leave no room for the death penalty? Not necessarily. One of my professors told me of how they would enact the death penalty in Ireland some time ago. A priest would spend a significant amount of time with the person condemned to death, assisting in a process of repentance and reconciliation with God, all the way until the point of the extermination. In this way they would prepare the condemned person to meet with God without fear of judgment, even if this earthly judgment is inevitable. After all, physical death is not the end of the person, nor the end of God's dealings with her.
How do we know that all persons deserve this? We might justify this principle in a lot of different ways, but a fine basis for making the judgment would be Christ's death in atonement for the sins of all persons. This is a clear enough teaching of the scriptures (e.g., 1 John 2.2). If Christ died for all (2 Cor 5.14), and if God wants the salvation of all (1 Tim 2.4), then this tells us something very important about the value of the human person. She is so valuable that God himself is willing to die the penalty due her so that she may live. This ought to inform our systems of justice and our treatment of every person!