Know of a certainty that the Lord your God will not drive these nations out from before you, anymore; and they will be a snare and an obstacle to you, and a goad in your sides and thorns in your eyes, until you perish from this good land, which the Lord your God has given you. (Prophets, Joshua, 23:12-23:13)
This is about reward and punishment. Moreover, punishment is also a reward and a correction; everything is aimed in one direction. Do not think that there is some kind of closeness or separation here. All of it brings a person toward the similarity with the Creator.
Question: It is said that we are not allowed to “intermarry with them,” which is a serious prohibition in the Torah. What does it mean?
Answer: This prohibition means that throughout various stages of development of egoism, there are desires that we cannot work with yet for the sake of bestowal, so we seemingly cut them off from ourselves. That is, prior to correction there can be no combination of egoistic and altruistic desires.
But afterward, as it is written, “intermarry with them and mingle with them,” because in the end everything will be corrected.
From KabTV’s “Secrets of the Eternal Book” 8/30/21