The view in Mishnah Sota 7:8 supports that the sages felt a convert and their descendant, such as King Agrippa, could serve as king of Israel.
https://www.sefaria.org/Mishnah_Sotah.7.8?lang=bi >
Ruth Rabbah and other Midrashim affirm and declare that Ruth did convert.
As I said in a comment, Ruth was/is considered a convert by her declaration denying her gods and affirming devotion to Israel’s God. Her story is read every year in the megilat of Ruth on Shavuot. Many Jewish sages and rabbis have written about her in this regard.
The Talmud states that Samuel wrote the scroll of Ruth to prove the choice of anointing David as king was halakhah, valid.
The Gemara asks: But the book of Ruth, with which the Writings opens, is also about suffering, since it describes the tragedies that befell the family of Elimelech. The Gemara answers: This is suffering which has a future of hope and redemption. As Rabbi Yoḥanan says: Why was she named Ruth, spelled reish, vav, tav? Because there descended from her David who sated, a word with the root reish, vav, heh, the Holy One, Blessed be He, with songs and praises.
(later) Samuel wrote his own book, the book of Judges, and the book of Ruth. Bava Batra 14b
Here is a beautiful article with many references to the tensions and resolutions regarding Ruth, and thereafter King David.
https://www.thetorah.com/article/megillat-ruth-when-kindness-conflicts-with-torah >
Rashi, Ibn Ezra, and other sages and rabbis affirm the validity of Ruth’s conversion to Judaism.
“May Hashem repay your action, and may your reward be complete from Hashem, G-d of Israel, under whose wings you have come to take shelter.” Ruth 2:12
(I will add quotes and links as I find them)
What truly matters is that God Himself commanded His prophet Samuel to anoint David as King of Israel. That alone answers to the question of David’s acceptance by God as truly a Jew and as Israel’s king.
And the Lord said to Samuel. . . Fill your horn with oil, and come, I will send you to Jesse the Bethlehemite, for I have seen for Myself a king among his sons. . . And you shall anoint for Me whom I tell you. . . And the Lord said Arise, anoint him, for this is he. . . And Samuel took the horn of oil and anointed him. . . And the Spirit of the Lord came mightily on David from that day forth. 1 Samuel 16:1, 3, 12, 13
Therefore David had every right to enter the tent of God’s presence (no temple was yet built, his son Solomon did that on God’s command), and to worship with the Lord’s assembly.