After confuting the human judgment with which the gentiles and Jews judged one another and commending God's judgment, the Apostle now undertakes to show that the things in which the Jews gloried do not suffice for their salvation. First, he states his position; second, he answers arguments against his position, at what advantage then has the Jew? (Rom 3:1).
The Jews gloried in two things, namely, the law and circumcision, which stemmed not from the law but from the patriarchs (John 7:22). First, therefore, he shows that the Jewish law heard or accepted was not enough for salvation; second, he... shows the same about circumcision, at circumcision indeed (Rom 2:25).
In regard to the first he does two things: first, he sets forth his position; second, he clarifies it, at for when the gentiles.
In regard to the first he sets forth two things: one by rejecting; the other by asserting.
For he rejects the Jewish opinion that they were made just by merely hearing the law. Hence he says: I have said that all who have sinned under the law will be judged by the law, for the hearers of the law, i.e., in virtue of having heard the law, are not just before God, even if they are deemed just before men: every one who hears these words of mine and does not do them is like a foolish man (Matt 7:26); if anyone is a hearer of the word and not a doer, he is like a man who observes his natural face in a mirror (Jas 1:23).
Second, he declares that the doers of the law are righteous, when he says, but the doers of the law will be justified: everyone who hears these words of mine and does them will be like a wise man (Matt 7:24); be doers of the word and not hearers only (Jas 1:22); a good understanding have all those who practice it (Ps 111:10).
But this point seems to conflict with his own statement below that by the works of the law no flesh will be justified before him (Rom 3:20). Consequently, no one is justified precisely for doing the works of the law.
The answer is that justification can be taken in three ways: in one way, in regard to reputation; then one is said to be justified, when he is regarded as just: you have made your sisters appear justified, i.e., by reputation (Ezek 16:51). In this sense, the doers of the law will be justified, i.e., are considered just before God and men.
Second, by doing what is just: this man went down to his home justified (Luke 18:14), because the publican performed a work of justice by confessing his sin. In this way is verified the statement that the doers of the law will be justified, i.e., by performing the justice of the law.
In a third way justification can be considered in regard to the cause of justice, so that a person is said to be justified, when he newly receives justice: being justified therefore by faith, let us have peace with God (Rom 5:1). It must not be supposed, however, that the doers of the law are justified as though acquiring justice through the works of the law. This cannot be accomplished either by the ceremonial works, which confer no justifying grace, or by the moral works, from which the habit of justice is not acquired; rather, we do such works in virtue of an infused habit of justice.
Source: Commentary on Romans