The issue of illegal immigration is not very clear in the Bible for several reasons. No civil law given in the Bible applies to nations today. The immigration laws given to the nation of Israel in the Old Testament were for Israel alone. The New Testament, which describes the foundation of the church age, exhorts believers to obey authorities, but it does not dictate civil law. God did not expect nations as a whole to follow Him. Guidance given in the New Testament relates to church administration and individual behavior, not civil law.
How does God view illegal immigration?
In the Old Testament, there was only one type of "illegal immigration": foreigners coming to reside in Israel who refused to obey the law God set out for them. For instance, alien residents were required to observe the Sabbath (Leviticus 25:6), the Feast of Unleavened Bread (Exodus 12:14-20), and the Feast of Atonement (Leviticus 16:29). They were to offer sacrifices correctly (Leviticus 17:8-9), not eat blood (Leviticus 17:10-12), remain sexually pure (Leviticus 18:26), and not worship idols (Leviticus 20:2). Any who broke Israel's laws were to face the same punishment as an Israelite (Numbers 15:16)—they were to be "cut-off," or exiled from society.
Law-abiding foreigners were welcome in Israel. Leviticus 19:34 explains why: "You shall treat the stranger who sojourns with you as the native among you, and you shall love him as yourself, for you were strangers in the land of Egypt: I am the Lord your God." It was the purpose of Israel to introduce God and the correct worship of God to the world. If a non-Jew wished to live with Jews and worship their God, it was to be encouraged. Aliens were not allowed to own land permanently because Israel was God's inheritance for the Jews, but they were to be provided for (Leviticus 23:22; Deuteronomy 10:18; 14:29). Numerous times, God placed the alien in the same category as the widow and the orphan, and directed the Israelites to provide for them fairly and generously (Deuteronomy 27:19).
The acceptance of immigrants into Israel was also evidence of God's caring character. Israel was supposed to be a land where people collectively obeyed Him, and He blessed the nation with prosperity in return. Other nations did not have this guarantee. Immigrants, who may have faced hardships or persecution at home, were welcome to take part of the common grace God bestowed on all of Israel. God cares about the aliens. "For the LORD your God is God of gods and Lord of lords, the great, the mighty, and the awesome God, who is not partial and takes no bribe. He executes justice for the fatherless and the widow, and loves the sojourner, giving him food and clothing" (Deuteronomy 10:17-18).
Modern nations are not expected to adopt Israel's civil law. It is hoped that authorities will enforce laws that provide peace and security to the citizens (Romans 13:1-7) and be founded on a respect for God's ethical law, such as no murder, no stealing. But God leaves the specifics to each nation. The biblical view of illegal immigration, therefore, is that an immigrant is illegal if they break the law. In many countries, it is illegal to immigrate outside of proper channels. Romans 13:1-7 says that residents of a nation are required to obey the laws of that nation. If it is illegal to immigrate, God's view is to not do it.
God does not primarily work with political nations in the church age, but that doesn't mean He never works through political nations. In general, His common grace will be granted most freely to those individuals and groups who follow His guidance. When He gives us a rule, it is because He is our creator, and He knows how we can live a good, fulfilled life. If a nation is designed to worship God and teach others to worship God, all immigrants should be allowed to stay and do so. But currently there are no nations whose national purpose is to be God's representatives on earth.
God's view of illegal immigration is, therefore, three-fold. If the circumstances of the immigration are illegal, immigration is sin (1 Peter 2:13-16). If an immigrant breaks the law in any other way, that transgression is sin and the transgressor is eligible for punishment. If a nation chooses to make immigration difficult for those fleeing hardship or persecution, that is within their sovereign rights, although it contradicts God's character.
What is a Christian response to illegal aliens/illegal immigrants?
What is the key to knowing the will of God?
Does God love everyone or just Christians?
Should a Christian join the military?
Is restitution a biblical mandate?