וַיְהִ֖י כְּשָׁמְעָ֣ם אֶת־הַתּוֹרָ֑ה וַיַּבְדִּ֥ילוּ כָל־עֵ֖רֶב מִיִּשְׂרָאֵֽל׃
百姓聽見這律法以後,就把一切混雜的外族人從以色列中分離出去。
Ibn Ezra
…God’s community meaning, he shall not be considered as one of God ’s community for purposes of marriage to an Israelite woman [Qiddushin 72b–73a]. The same applies to an Ammonite (but not an Ammonitess), and a Moabite (but not a Moabitess).