The strongest reason any nation can have to fight illegal immigration is the preservation of its racial composition.
Why did America remain 90% white from 1776 to 1960?
Because the US defined itself as a white nation during those almost 200 years and didn't allow any threat to its white majority to exist for very long be it legal or illegal immigration (Chinese Exclusion Act, Operation Wetback, etc, etc...)
When America redefined itself as a multiracial country in the 60's the country lost its strongest reason to fight illegal immigration.
Multiracial countries like post-1960 America think like this:
"We are not a white country anymore. Illegal immigation is overwhelmingly non-white, therefore illegal immigration is a positive thing. It will turn us into a country without a racial majority sooner rather than later."
Why do you think China has almost zero illegal immigration despite its enormous economic development?
Because China defines itself as a country for the Han Chinese and therefore fiercely protects its racial composition against the threat illegal immigration pose to its racial self-definition.
America is richer than her southern neighbors at least since 1850.
Why do you think hispanic illegal immigration was never a serious problem before 1960?
Because being a white country always "forced" America to fight non-white legal or illegal immigration to protect what was considered back then as one of the fundamental pillars of the nation.