“For the promise that he would be the heir of the world was not to Abraham or to his seed through the law, but through the righteousness of faith. For if those who are of the law are heirs, faith is made void and the promise made of no effect, because the law brings about wrath; for where there is no law there is no transgression.” Rom 4:13-15
Paul has already said that Abraham received justification before God, before he was circumcised, so that the righteousness that is of God (from Rom 3) is of faith for both the uncircumcised and the circumcised. Paul is not saying that circumcision in and of itself is an enemy of faith. For God, who cannot be pleased without faith, instituted circumcision for Abraham and his seed. Circumcision does not benefit God in any way; it is for man’s benefit – it is the outward expression of the what we hope to be the state of the inward heart – circumcised (cutting away of the flesh) toward God.
Baptism is the same – what does it benefit God? Baptism benefits us as an outward sign of an inward reality.
So circumcision, or more broadly, our action, our works, follows faith, it does not precede it. All Paul is saying is that faith sets us in right standing, in relationship, with God; then what we do in obedience to God flows from our faith and our relationship. Works cannot establish the relationship, it can only be evidence of a relationship that already exists.
Now in verse 13 and 14, what does Paul mean when he says “through the law” and “of the law”? I think he is continuing in the same vein that he began already in Romans – that those who try to earn righteousness through their obedience to the Law, as the Pharisees did, could not inherit the promise that was given to Abraham’s children who are not his children of the flesh (Ishmael) but who are his children through faith in the promise (Isaac). In the same way, those who try to establish their own righteousness based on obedience of the Law, cannot be the heirs of the promise.
Paul is not saying that we should ignore what God considers righteous behavior and sinful behavior — ignore the Torah now. He just reiterated to us not to make that mistake in Rom 3:31. So do not read verse 14, “For if those who are of the law are heirs, faith is made void and the promise made of no effect,” and think if we obey God’s commandments then we have excluded ourselves from being heirs. He is talking about those whose righteousness is of the Law. But he is continuing to develop his argument, that righteousness before God is of faith and is not of obedience to Torah (“of the law” or “through the law”).