Ruth 1:4
Was King David disqualified from the congregation as a "bastard"?
"A bastard shall not enter into the assembly of Yahweh; even to the tenth generation shall none of his enter into the assembly of Yahweh" (Dt. 23:2).
And yet, it is said, David was a ninth-generation descendant of Perez, the bastard son of Judah and Tamar (Gen. 38:24-30 ; Ruth 4:18 ; 1 Chron. 2:5-14 ) and was allowed into the assembly.
The word the KJV uses for "bastard" is mamzer -- a word used only twice in the NT, here and in Zech. 9:6. This word comes from a root meaning "alienate" and is used in the sense of a mongrel, i.e., according to Strong's, "born of a Jewish father and a heathen mother."
In light of this context, Tamar wasn't married to Judah, true enough, but for this to be an issue, she would have had to be a heathen -- and we see no indication of that in the text.
It may be said that "mamzer" has other meanings: A person born of adultery, a person born of incest, or a person born of a forbidden or mixed marriage." On the latter David is said to still be out because his ancestress Ruth was Moabite.
But generally: As a female, Ruth was able to be absorbed into the Jewish nation (due to the principle of patrilineal descent) and as a believer in the true God was no more considered a "heathen" of the sort forbidden for marriage under the definition of mamzer.