The need for the Lord to separate this branch of Joseph from the rest of the House of Israel is expressed in the allegory of the olive tree. When the tree began to decay initially, most of the main branches were decaying and the roots were no longer providing the needed sustenance. The Lord had nourished a few tender branches which had to be replanted because of the mother tree had begun to wither, And behold, saith the Lord of the vineyard, I take away many of these young and tender branches, and I will graft them whithersoever I will; and it mattereth not that if it so be that the root of this tree will perish, I may preserve the fruit thereof unto myself; wherefore, I will take these young and tender branches, and I will graft them whithersoever I will (Jacob 5:8).
There are other examples when the Lord has had to separate a group of people in order to keep their religious traditions pure. One of the reasons why the Israelites were so leery of marrying Gentiles is that the Lord did not want them succumbing to Gentile forms of idolatry (Deut 7:2-4, Josh 23:12-13). Unfortunately, mixing with the wicked has a greater tendency to pull down the righteous than it does to reform the wicked. Other examples include the people of Enoch, the Jaredites, the early Nephites, and the other scattered tribes of Israel.
Hugh Nibley
"The resemblance of one migration of God's people to another is not an accident, according to the Book of Mormon. In every age when the wicked reach a point of no return they are stopped from frustrating God's plan…by bringing about a forceful separation between the two. One might call it a form of quarantine." (An Approach to the Book of Mormon, p. 137)