Am Ha'aretz: Friend or Foe; How are the Jews to Relate to their Neighbors?
(א) וּכְכַלּ֣וֹת אֵ֗לֶּה נִגְּשׁ֨וּ אֵלַ֤י הַשָּׂרִים֙ לֵאמֹ֔ר לֹֽא־נִבְדְּל֞וּ הָעָ֤ם יִשְׂרָאֵל֙ וְהַכֹּהֲנִ֣ים וְהַלְוִיִּ֔ם מֵעַמֵּ֖י הָאֲרָצ֑וֹת כְּ֠תוֹעֲבֹֽתֵיהֶם לַכְּנַעֲנִ֨י הַחִתִּ֜י הַפְּרִזִּ֣י הַיְבוּסִ֗י הָֽעַמֹּנִי֙ הַמֹּ֣אָבִ֔י הַמִּצְרִ֖י וְהָאֱמֹרִֽי׃ (ב) כִּֽי־נָשְׂא֣וּ מִבְּנֹֽתֵיהֶ֗ם לָהֶם֙ וְלִבְנֵיהֶ֔ם וְהִתְעָֽרְבוּ֙ זֶ֣רַע הַקֹּ֔דֶשׁ בְּעַמֵּ֖י הָאֲרָצ֑וֹת וְיַ֧ד הַשָּׂרִ֣ים וְהַסְּגָנִ֗ים הָֽיְתָ֛ה בַּמַּ֥עַל הַזֶּ֖ה רִאשׁוֹנָֽה׃ (ס)
(1) When this was over, the officers approached me, saying, “The people of Israel and the priests and Levites have not separated themselves from the peoples of the land whose abhorrent practices are like those of the Canaanites, the Hittites, the Perizzites, the Jebusites, the Ammonites, the Moabites, the Egyptians, and the Amorites. (2) They have taken their daughters as wives for themselves and for their sons, so that the holy seed has become intermingled with the peoples of the land; and it is the officers and prefects who have taken the lead in this trespass.”
(א) בַּיּ֣וֹם הַה֗וּא נִקְרָ֛א בְּסֵ֥פֶר מֹשֶׁ֖ה בְּאָזְנֵ֣י הָעָ֑ם וְנִמְצָא֙ כָּת֣וּב בּ֔וֹ אֲ֠שֶׁר לֹא־יָב֨וֹא עַמֹּנִ֧י וּמֹאָבִ֛י בִּקְהַ֥ל הָאֱלֹהִ֖ים עַד־עוֹלָֽם׃
(1) At that time they read to the people from the Book of Moses, and it was found written that no Ammonite or Moabite might ever enter the congregation of God,
(ב) וַיִּגְּשׁ֨וּ אֶל־זְרֻבָּבֶ֜ל וְאֶל־רָאשֵׁ֣י הָֽאָב֗וֹת וַיֹּאמְר֤וּ לָהֶם֙ נִבְנֶ֣ה עִמָּכֶ֔ם כִּ֣י כָכֶ֔ם נִדְר֖וֹשׁ לֵֽאלֹהֵיכֶ֑ם ולא [וְל֣וֹ ׀] אֲנַ֣חְנוּ זֹבְחִ֗ים מִימֵי֙ אֵסַ֤ר חַדֹּן֙ מֶ֣לֶךְ אַשּׁ֔וּר הַמַּעֲלֶ֥ה אֹתָ֖נוּ פֹּֽה׃ (ג) וַיֹּאמֶר֩ לָהֶ֨ם זְרֻבָּבֶ֜ל וְיֵשׁ֗וּעַ וּשְׁאָ֨ר רָאשֵׁ֤י הָֽאָבוֹת֙ לְיִשְׂרָאֵ֔ל לֹֽא־לָ֣כֶם וָלָ֔נוּ לִבְנ֥וֹת בַּ֖יִת לֵאלֹהֵ֑ינוּ כִּי֩ אֲנַ֨חְנוּ יַ֜חַד נִבְנֶ֗ה לַֽיהוָה֙ אֱלֹהֵ֣י יִשְׂרָאֵ֔ל כַּאֲשֶׁ֣ר צִוָּ֔נוּ הַמֶּ֖לֶךְ כּ֥וֹרֶשׁ מֶֽלֶךְ־פָּרָֽס׃

(2) they approached Zerubbabel and the chiefs of the clans and said to them, “Let us build with you, since we too worship your God, having offered sacrifices to Him since the time of King Esarhaddon of Assyria, who brought us here.” (3) Zerubbabel, Jeshua, and the rest of the chiefs of the clans of Israel answered them, “It is not for you and us to build a House to our God, but we alone will build it to Adonai God of Israel, in accord with the charge that the king, King Cyrus of Persia, laid upon us.”

(ב) וַיִּבָּֽדְלוּ֙ זֶ֣רַע יִשְׂרָאֵ֔ל מִכֹּ֖ל בְּנֵ֣י נֵכָ֑ר וַיַּעַמְד֗וּ וַיִּתְוַדּוּ֙ עַל־חַטֹּ֣אתֵיהֶ֔ם וַעֲוֺנ֖וֹת אֲבֹתֵיהֶֽם׃

(2) Those of the stock of Israel separated themselves from all foreigners, and stood and confessed their sins and the iniquities of their fathers.

Baba Kamma 38a

But isn’t it taught in a baraita that Rabbi Meir says: From where is it derived that even a gentile who engages in Torah is considered like a High Priest? The verse states with regard to the mitzvot: “Which if a person does, he shall live by them” (Leviticus 18:5). It is not stated: Which if priests and Levites and Israelites do, they shall live by them, but rather: A person, indicating that all people are included. You have therefore learned that even a gentile who engages in Torah study is considered like a High Priest.

Tiferet Yisrael on Avot 3:14

Even if our sages had not explicitly taught (that righteous Gentiles have a place in the World to Come) we would have understood this ourselves since God is righteous in all [of God's] ways … and we see many of the righteous Gentiles who not only recognize the Creator and believe in the divine origin of the Torah and also act charitably