Then when he says, for whosoever, he explains the reason.
For if all who sinned are punished, it is clear that there is no respect of persons with God. Hence, he speaks first of those who have not received the law, saying that for whosoever has sinned without the law received from God by Moses, will perish without the law, i.e., will be condemned, but not for transgression of the law: because no one understands, they will perish forever (Job 4:20).
Second, he speaks of those who received the written law, and he says that whosoever has sinned in the law, i.e., after the written law, will be j...udged by the law, i.e., precisely for having transgressed a precept of the law: the word which I have spoken will be his judge on the last day (John 12:48).
The Apostle's manner of speaking here has been taken as an occasion of error by some. Because the Apostle does not say that all who sinned under the law will perish by the law, as he had said of those who are without the law that they will perish without the law, some believed that those who sin after receiving the law will be judged by some means, i.e., in the present, but will not perish.
But as the Gloss says: what Christian would say that the Jew will not perish for not believing in Christ, when the Lord says that it will be more tolerable on the day of judgment for the land of Sodom than for them? (Matt 10:15). Hence it says: I have no pleasure in the death of the sinner (Ezek 18:32).
But the Apostle uses these different expressions because, as Gregory says on Job 36:6: he gives judgment to the poor, some will perish in the future judgment without being judged, i.e., the wicked who are without faith and the law: the wicked will not stand in the judgment (Ps 1:5), namely, because there is no basis for discussion with one entirely estranged from God: he who does not believe is condemned (John 3:18).
But others who sin in spite of having received the law and faith will perish in such a way as also to be judged through a discussion held with them; hence, it is said: I judge between sheep and sheep, rams and he-goats (Ezek 34:17), just as a king condemns enemies without a hearing, but citizens with a careful examination, as Gregory says.
Source: Commentary on Romans