Are you saying NOT to do that?
....if a stranger dwells with you in your land, you shall not mistreat him.The locus of attention in the above verse is on the behavior of (existing) residents of the land. That same Mosaic Law demanded that all the Israelite laws apply to anyone and everyone occupying land within Israel's borders. In other words, once the theoretical stranger "dwells with you in your land" i.e. sets foot inside Israel's borders (legally or illegally), the native Israelite was not to mistreat him - instead, the native Israelite was expected to hold him subject to all of Israel's laws (including any that might govern citizenship and government handouts), just as he himself would be. The "stranger within your gates" would also be expected to know those laws for himself....
The stranger who dwells among you shall be to you as one born among you, and you shall love him as yourself; for you were strangers in the land of Egypt: I am the LORD your God.
-- Leviticus 19: 33-34
...when all Israel comes to appear before the LORD your God in the place which He chooses, you shall read this law before all Israel in their hearing.The question that the "love your neighbor" crowd needs to answer is what constitutes "love your neighbor" behavior when confronted with a lawbreaking stranger within your gates?
Gather the people together, men and women and little ones, and the stranger who is within your gates, that they may hear and that they may learn to fear the LORD your God and carefully observe all the words of this law,
and that their children, who have not known it, may hear and learn to fear the LORD your God as long as you live in the land which you cross the Jordan to possess.
-- Deuteronomy 31:11-13