On that day, when the scroll from Moses was being read to the people, they found written in it that no Ammonite or Moabite should ever enter God's assembly.
References for Nehemiah 13:1
This is because they hadn't met the Israelites with food and water but instead hired Balaam against them to curse them. Yet our God turned the curse into a blessing.
When the people heard this law, they separated out from Israel all those of mixed descent.