The reason I see for restricting legal immigration is to give the country a chance to assimilate the immigrants. Before 1965, the immigrant pool was restricted to 250,000 people a year, mostly from Europe.
As for illegals, catapult them back to where they originated.