When God led the children of Israel into the Promised Land he intended to drive the Canaanites out before them.
He brought you out of Egypt by his Presence and his great strength, to drive out before you nations greater and stronger than you and to bring you into their land to give it to you for your inheritance, as it is today (Deut 4:38).The Israelites disobeyed and allowed them to stay, but God wanted them out to clear the land of evil spirits that they carried.
However, once the Israelites were in the land, and it was clear of evil, God was quite happy for aliens to return. The only condition was that they agreed to serve the Lord and live by his laws.
But you must keep my decrees and my laws. The native-born and the foreigners residing among you must not do any of these detestable things (Lev 18:26).Foreigners were welcome in the land, but they must not do anything that would compromise the spiritual protection of the people. Detestable activities that would open away for evil spirits were prohibited.
Once they had returned to the Land, these foreigners were entitled to equal treatment under the law.
The same law applies both to the native-born and to the foreigner residing among you (Ex 12:49).
You are to have the same law for the foreigner and the native-born. I am the Lord your God (Lev 24:22).The laws must be the same for foreigners and native-born people. Foreigners must not be treated badly.
Do not mistreat or oppress a foreigner, for you were foreigners in Egypt (Ex 22:21).
Do not deprive the foreigner or the fatherless of justice (Deut 24:17).
When a foreigner resides among you in your land, do not mistreat them. The foreigner residing among you must be treated as your native-born. Love them as yourself, for you were foreigners in Egypt. I am the Lord your God (Lev 19:33-34).
The community is to have the same rules for you and for the foreigner residing among you; this is a lasting ordinance for the generations to come. You and the foreigner shall be the same before the Lord: The same laws and regulations will apply both to you and to the foreigner residing among you (Num 15:15-16).Foreigners should not be seen as an inconvenience. God loves them as much as native-born people.
He defends the cause of the fatherless and the widow, and loves the foreigner residing among you, giving them food and clothing. 19 And you are to love those who are foreigners, for you yourselves were foreigners in Egypt (Deut 10:18-19).