I read the book of Ezra today. I must admit that it is nice to finally be moving forward with the History of Israel. The book of Ezra picks up after Judah and Israel have been in exile. After many years Persia allows some of the exiled people to return to Jerusalem to rebuild the temple of God. Ezra is a priest of God living in Persia and requested to return to Jerusalem so that he could bring priests and servants to the new temple built in Jerusalem. Artaxerxes, the King of Persia grants him his request.

When Ezra gets to Jerusalem he is troubled that the exiles that had returned from Persia have married foreign women and have “taken up the detestable practices of the Canaanites, Hittites, Perizittes, Jebusites, Ammonites, Moabites, Egyptians, and Amorites.

At first it seems that God may dislike intermarriage between different nations, and peoples. Then I remembered Ruth, the Moabite. She is the great grandmother of King David. Her son was Obed and her husband was Boaz. So something must have been different about Ruth because it was certainly alright for Boaz to marry Ruth. The difference is, Ruth followed the one true God. Not other gods. This is the key to understanding why the people were asked to not intermarry. The issue is “Will your spouse worship God or will they worship other gods?” If your spouse worships the one true God, then the marriage is fine. Even if the spouse is a Moabite. Just as with Ruth and Boaz. However, if the spouse worships other gods then marriage should not happen between the two, because a spouse will have influence and bring the other to worship other gods. And this whole worshiping other gods things is a really big deal.

Many of the people of Israel, and even some of the priests and Levites, have not kept themselves separate from the other peoples living in the land. They have taken up the detestable practices of the Canaanites, Hittites, Perizzites, Jebusites, Ammonites, Moabites, Egyptians, and Amorites. For the men of Israel have married women from these people and have taken them as wives for their sons. So the holy race has become polluted by these mixed marriages. Worse yet, the leaders and officials have led the way in this outrage.
— Ezra 9:1-2

So Ezra is not teaching racism.
He is teaching about spiritual purity within the family of God. And this is something that we should take seriously today as well. A Christian should not marry a non-christian for the same reasons that Ezra described to Israel regarding intermarriage. Our spouse has a great influence on us, and if they worship other gods then this is not the influence God would desire for us.