The problem is not laws, it’s money. There is an international treaty that obliges the USA to accept asylum seekers - those who are at risk of life and limb, etc. etc. for persecution in their home country. The problem is the backlog in the courts that determine who is a refugee. So an illegal migrant can be deported - once a court determines they are not qualified as a refugee…
The point has been made often - that asylum seekers cannot be shoppers. they are no longer asylum seekers once they have reached a safe country. The debate, logically, is whether Mexico is a safe country? That is open to debate.
Canada, years ago, started enforcing the “safe country” rule. Unfortunately, the USA is at times eager to deport some non-citizens, meaning some argue here that the USA is “not a safe country”. Meanwhile, there’s the loophole in both countries - if a foreign citizen is apprehended already on your territory, not at a border crossing, then the country they came from (such as Mexico) is not obliged to take back someone not their citizen, even if they “obviously came from there”. You’re stuck with them until their refugee status is established.
What’s also at debate is what constitutes persecution - is risk from organized crime a valid reason to be a refugee? Societies where the authorities look the other way hen gay people are assaulted and killed? etc.
Then, when someone applies for asylum, there is a court hearing to determine if their claim is valid. Like everything legal, this has been allowed to slip - bigly. IIRC the current backlog is 3 years. Economic migrants - simply looking for a better paying job - are not valid refugees. One of the things in the current bill being hashed out in the senate is apparently to actually put some money toward increasing the number of people involved in the refugee courts, to speed the determination.
And obviously, someone disappears into the woodwork, and if they lose their case, then INS has to go find them, 3 years later, and try to deport them. Meanwhile, since some people have been in the country for decades and are still liable for deportation, some jurisdictions are hostile to long-time residents being rounded up and do not want to cooperate with the Immigration cops.