Paul’s argument that Israel has not kept the Law does not begin in Romans 2.17 or even in Romans 2.1. Romans 1.18ff has Scriptural allusions that show that Israel’s sin is involved in the sin of the Greeks. The Gentiles are not off, “by themselves,” going off on their own way. They are going off against what they have learned from the Israelites scattered among them or what those Israelites should have taught but did not.
Remember, when Paul was disgusted with idolatry in Athens, he began dealing with the Jews in that area as well as the pagan themselves:
Now while Paul was waiting for them at Athens, his spirit was provoked within him as he saw that the city was full of idols. So he reasoned  in the synagogue with the Jews and the devout persons, and  in the marketplace every day with those who happened to be there.
In fact, Paul’s ministry involved dealing with occultism among the Jews and Proselytes. Acts 13:
When they had gone through the whole island as far as Paphos, they came upon a certain magician, a Jewish false prophet named Bar-Jesus. He was with the proconsul, Sergius Paulus, a man of intelligence, who summoned Barnabas and Saul and sought to hear the word of God. But Elymas the magician (for that is the meaning of his name) opposed them, seeking to turn the proconsul away from the faith.
And Acts 19:
Then some of the itinerant Jewish exorcists undertook to invoke the name of the Lord Jesus over those who had evil spirits, saying, “I adjure you by the Jesus whom Paul proclaims.” Seven sons of a Jewish high priest named Sceva were doing this. But the evil spirit answered them, “Jesus I know, and Paul I recognize, but who are you?” And the man in whom was the evil spirit leaped on them, mastered all of them and overpowered them, so that they fled out of that house naked and wounded. And this became known to all the residents of Ephesus, both Jews and Greeks. And fear fell upon them all, and the name of the Lord Jesus was extolled. Also many of those who were now believers came, confessing and divulging their practices. And a number of those who had practiced magic arts brought their books together and burned them in the sight of all. And they counted the value of them and found it came to fifty thousand pieces of silver.
All the evidence leads us to think this is the proselyte community. Even if the pagans believed magic was shameful and had to be hidden (which I find doubtful, but I’ll let someone inform me otherwise if they have studied the question), the context is Jews and their Greek followers.
So while Romans 1.18ff does deal with Gentile sin in the Mediterranean world (Greek), it also hints strongly at Jewish compromise and corruption being involved in it.
This helps Paul’s transition in Romans 2 make sense:
Though they know God’s decree that those who practice such things deserve to die, they not only do them but give approval to those who practice them. Therefore you have no excuse, O man, every one of you who judges. For in passing judgment on another you condemn yourself, because you, the judge, practice the very same things.
Typically the “therefore” would follow from what has already been said. But Paul has just said it is worse to approve of the things than to merely do them. So how can he say that one should not condemn such actions? Perhaps because he has already alluded to the fact that for Israel to pretend to be separate from the cycle of judgment is mere pretense. Everyone knows that Israel is involved.
Which brings us to the “man” of Romans 2:
Therefore you have no excuse, O man, every one of you who judges. For in passing judgment on another you condemn yourself, because you, the judge, practice the very same things. We know that the judgment of God rightly falls on those who practice such things. Do you suppose, O man—you who judge those who practice such things and yet do them yourself—that you will escape the judgment of God? Or do you presume on the riches of his kindness and forbearance and patience, not knowing that God’s kindness is meant to lead you to repentance? But because of your hard and impenitent heart you are storing up wrath for yourself on the day of wrath when God’s righteous judgment will be revealed…
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.”
But did every single Jew engage in these practices? We know from the Gospels that not every Jews sinned in that way. The “you” or Romans 2 is much like the “I” of Romans 7, a representation of Israel. The Jews are notorious covenant-breakers and it destroys their witness. They produce blasphemy rather than conversion among the Gentiles.
The point of Paul’s condemnation is not to convince anyone of universal human sinfulness.
Would Paul’s argument then pass by the righteous Jews like Zecharias and Elizabeth, Simeon, and Anna? Consider the prayer of Daniel. Israel’s failure to keep the law as a nation meant that God’s appointed role for the nation had been abandoned by the nation. No righteous individual could change that.
So there was no point in an Israelite boasting in his covenant with God. It was all an obvious and undeniable failure. (Note the contrast with Paul’s boasting. The issue is not that to “boast in God” is some sort of code-word for boasting in self. The issue is that Christ is now actually accomplishing something that the Law never enabled Israel to do).
Finally, when Paul says, “The name of God is blasphemed among the Gentiles because of you,” he is talking about the sin he has been describing in Romans 1.18ff. The Gentiles are not sinning against general revelation. In Acts 14 and 17, Paul treats general revelation as something that should lead Gentiles to search for special revelation. He doesn’t treat it as ending all ignorance. In Romans 1.18ff he’s talking about Gentiles in the wake of the post-exilic dispersion of the Jews throughout the Mediterranean world. The things “that have been made” is probably a mistranslation. God is has been known in the things “that have been done” since the creation of the world. Remember, when Paul speaks of Gentiles who “keep the precepts of the law” and who “condemn you who have the written code.” he is speaking of actual cases of Gentiles who did just that (here, here). And to “have the written code” does not mean you alone have heard it or own a copy of it on a scroll, but that you alone are covenantally entrusted with it (Romans 3.1).