But we must consider how He can be just, and can dispose all things justly, if He condemns Him who ought not to be punished. For our Mediator owed no punishment for Himself, since He wrought nothing that could infect Him with guilt. But if He had not undergone a death that was not His due, He would never have freed us from the death due to us. Therefore, though the Father is just, yet when He punishes the Just He orders all things justly; because through Him He justifies all things, in that on behalf of sinners He condemns Him who is without sin, so that all the elect might rise up to the height of righteousness in Him in whom He who is above all endures the penalties of our unrighteousness. . . . For the rust of vice can only be purged by the fire of torment. And so He came, without fault, freely to submit Himself to the torment, that the punishments due to our iniquity might lose their rightful victims, in that they unjustly held Him who was free from their power (Magna Moralia, iii. 14, quoted in L. W. Grensted, A Short History of the Doctrine of the Atonement , p. 98).
In Gregory, indeed, the discussion is not carried very far. He is content with the assertion, unexplained and undefended, that the punishment of the innocent sets free those who are guilty. There is no discussion of the exact equivalence of Christ's punishment with that due to us. Nor does Gregory attempt to make it clear how one injustice can make just a lapse of justice, save to point out that it was by His own choice, and not involuntarily, that Christ underwent suffering and death (p. 99).
As Grensted notes, Gregory does not make much of an effort to explain how the obviously unjust act of punishing an innocent can be performed by the Father without undermining his justice. He simply states that it happened, and since "God orders all things justly," therefore, it must have been just for God to do so. This position assumes a priori that whatever God does is just and therefore if he does something that appears to be unjust to man, it must be only apparent and not real.
Then Gregory mentions the red-herring that virtually every defender of the Penal Substitutionary Theory (PST) of the atonement mentions--that Jesus died voluntarily. I say this is a red-herring because that is not the issue. The issue is how could a God of justice and truth accept the punishment of an innocent as an act of justice. Obviously if the innocent was punished unwillingly that would just add to the injustice but it does not solve it.