Here is an account of retributive punishment. We have a prima facie duty of justice to disrupt wicked plans. Now, a typical wicked plan does not have evil as its end, but as one of the means towards that end—"Embezzle in order to have more money." The best option is to disrupt evil plans before the evil means has been implemented. But even if the evil means has already been implemented, the plan may not be complete, since the good end has yet to be reached. And so while it is not possible to stop the evil, it still is possible to frustrate the wicked plan, by ensuring that a desired end does not flow from the evil means.
Suppose the thesis that when people act wickedly, they do so at least in part to contribute to their own satisfaction. Then, satisfaction is one of the ends in the wicked action (there may be others), and by making the evildoer miserable (e.g., by putting her in jail or requiring that she write out "I will not embezzle money from my employer" once for every dollar stolen), we are frustrating her plan—we are ensuring that at least one of the ends does not follow from her evil means.
But notice that here the frustrating of the designs goes beyond just ensuring the designs are not successful. In punishment, we frustrate the designs by turning them upside-down—not just by making sure that the evildoer is actually not satisfied, but by ensuring she is dissatisfied. But why is this right? The mere idea of frustrating the designs of the wicked does not seem to require this. Yet it seems just.