This has always been a tactic and effort of Satan since (Gen. 3:15). God told Satan, "And I will put enmity between thee and the woman, and between thy seed and her seed; it shall bruise thy head, and thou shalt bruise his heel."
Thus, Satan's attempt to pollute the seed line from whom will come the Messiah. (Gen. 6:1-3) "And it came to pass, when men began to multiply on the face of the earth, and daughters were born unto them, That the sons of God saw the daughters of men that they were fair; and they took them wives of all which they chose."
It doesn't matter if you consider this a mixing of the angelic race with the human, or the mixing of Seth's line with Cain's line. The point remains it was an attempt to mix the holy seed with those who were not. Strange isn't it. Satan believes the Word of God. And he does what he can to prevent it. Causing God to bring the flood and destroy all mankind but 8 souls.
And again, after God created the nation of Israel and they are marching through the wilderness, they encountered the people of Moab. (Numbers 25:1-2) "And Israel abode in Shittim, and the people began to commit whoredom with the daughters of Moab. And they called the people unto the sacrifices of their gods: and the people did eat, and bowed down to their gods." This mixing of the holy race with the foreign race resulted in Israel moving to worship the foreign gods. (Numbers 25:3) "And Israel joined himself unto Baal-peor: and the anger of the LORD was kindled against Israel."
(Numbers 25:4-5) "And the LORD said unto Moses, Take all the heads of the people, and hang them up before the LORD against the sun, that the fierce anger of the LORD may be turned away from Israel. And Moses said unto the judges of Israel, Slay ye every one his men that were joined unto Baal-peor.
And it was at this time that Ezra's distant relative Phinehas killed the whoring Israelite and Midianite woman which turned away the wrath of God. (Num. 25:7-13) And Phinehas blood would flow in Ezra, and his spirit. He would know and remember this.
Then after some time of law giving, and preparing for the next generation to enter the promised land, and pronouncing the changing of the guard from Moses to Joshua, (Num. 25-30), God orders Moses to make war with Midian. (Num. 31:7-8) "And they warred against the Midianites, as the LORD commanded Moses; and they slew all the males. And they slew the kings of Midan..."
But, (Ezra 31:9) "And the children of Israel took all the women of Midian captives, and their little ones...." And when Moses found out, he was angered. (Num. 31:16-17) "Behold, these caused the children of Israel, through the counsel of Balaam, to commit tespass against the LORD in the matter of Peor, and there was a plague among the congregation of the LORD. Now therefore kill every male among the little ones, and kill every every woman that hath known man by lying with him."
The counsel of Balaam taught this tactic to the enemy of Israel. Balaam was an erring prophet of God. Hard to believe, but that is what it says. But is it any harder to believe that the leaders of the remnant, the priests and rulers, were the main ones guilty of mingling the holy seed with foreigners? (Ezra 9:2) Baalim would die for his sins. (Num. 31:8)
And later David's son Solomon would commit the same sin, causing the splitting of the nation Israel, and eventually the 70 year captivity. See again, (1 Kings 11:1-33) Foreign women through sex and mixing with the chosen race would turn the people of God against Him, and they would serve another. An old but successful tactic.
And now the remnant falls prey once again. Made Ezra pull his hair out.
Quantrill