“But if you call yourself a Jew and rely on the law and boast in God and know his will and approve what is excellent, because you are instructed from the law; and if you are sure that you yourself are a guide to the blind, a light to those who are in darkness, an instructor of the foolish, a teacher of children, having in the law the embodiment of knowledge and truth— you then who teach others, do you not teach yourself? While you preach against stealing, do you steal? You who say that one must not commit adultery, do you commit adultery? You who abhor idols, do you rob temples? You who boast in the law dishonor God by breaking the law. For, as it is written, “The name of God is blasphemed among the Gentiles because of you.”” -Romans 2:17–24
In verses twenty-one to twenty-three, Paul begins to detail the kinds of hypocrisy for which the Jews were guilty. He appears to be quoting loosely from Psalm 50:18 “If you see a thief, you are pleased with him, and you keep company with adulterers.”
But he may also be drawing from our Lord’s Sermon on the Mount (Matt. 5:21–48), at least in form
“And he said to them, “You have a fine way of rejecting the commandment of God in order to establish your tradition! For Moses said, ‘Honor your father and your mother’; and, ‘Whoever reviles father or mother must surely die.’ But you say, ‘If a man tells his father or his mother, “Whatever you would have gained from me is Corban” ’ (that is, given to God)— then you no longer permit him to do anything for his father or mother, thus making void the word of God by your tradition that you have handed down. And many such things you do.”” -Mark 7:9–13
“You have heard that it was said, ‘You shall not commit adultery.’ But I say to you that everyone who looks at a woman with lustful intent has already committed adultery with her in his heart.” -Matthew 5:27–28
“And Jesus entered the temple and drove out all who sold and bought in the temple, and he overturned the tables of the money-changers and the seats of those who sold pigeons. He said to them, “It is written, ‘My house shall be called a house of prayer,’ but you make it a den of robbers.”” -Matthew 21:12–13 (The Talmud also documents Jews who would profit by facilitating the sell of idols to Gentiles though they would not worship the idols themselves.)
Those same Jews who were boasting in the law (reveling in their privilege) were dishonoring God by breaking that law. Like whitewashed sepulchers, they were washed and painted up nice on the outside while they were filled with decomposing bodies on the inside (Matthew 23:27-28).