Wikipedia says that Naamah, wife of Solomon, was an Ammonite. That is the mom of Rehabeam. King of Judah.
Ruth is a Moabite. That is one ancestor of David.
Okay, so Jews have these prohibition against marrying foreign women. Moreover, certain nations, such as the Ammonites and the Moabites (as opposed to, say, the Chinese?) seem to be super prohibited in that Hashem prohibited them specifically.
Deuteronomy 23:4 says
An Ammonite or a Moabite shall not enter into the assembly of the LORD; even to the tenth generation shall none of them enter into the assembly of the LORD for ever
Okay, so we got a Moabite, Ruth. We got Naamah the Ammonite. Not only they join Hashem's congregation. They became king and queen.
Even in US, that's not instituted based on racism, it took quite a while before a black guy can become supreme court justice, and it's still cause quite an uproar. Yet it seems that there is no issue with descendant of Moabites and Ammonites getting a supreme seat in Israel.
So what's the story?