One aspect of the immigration debate that makes some advocates for illegal immigrants often unfairly suspect their opponents of racism is the relatively new distinction between legal and illegal immigration. After all, the preceding inhabitants of North America always have been dubious of the newcomers, beginning with the Native Americans, who were even stingier in granting visas than Congress is today. Unfortunately for their rhetoric, they didn't have the term "illegal" in their arsenal because until about 1924, most people who got on a boat and made it to the U.S. were immigrants without modification or qualification.
Before the Constitution put the power "To establish an uniform Rule of Naturalization" in Congress's hands, some colonies would provide benefits only to Protestant immigrants, while Catholics were allowed to come ashore only after the ship's captain had paid a surcharge on each of their heads. The Naturalization Act of 1790 limited citizenship to "free white persons," and even after U.S.-born nonwhites were recognized as citizens through the 14th Amendment, Congress in 1882 prohibited permanent residency by Chinese and other Asians, leading to the original "guest worker" programs in which certain aliens could come work in the U.S., yet never become citizens nor bring over their families. But pretty much any white person who showed up at Ellis Island would be processed, her name mangled and her possessions doused with the disinfectants of the day, and then sent off to whomever she claimed to be the acquaintance with whom she would reside. (Or at least this is the impression I've gotten from the Ellis Island and Tenement Museums.) In 1907, 1.25 million people were processed at Ellis alone.
The first significant restrictions on white immigrants came with the Emergency Quota Act of 1921, which limited the total annual number of immigrants to 357,802 but made many groups exempt from that quota. The Immigration Act of 1924 tightened it to 164,000, and also originated the modern system of having foreign consulates vet applicants and grant them visas, rather than simply telling ships that bore immigrants whether there was room left that year and making the ships that carried excess immigrants responsible for taking them back home. So one could say that only in 1924 did we begin to have illegal immigration as we currently understand it: movement into the United States without the required permission from our government. And until 1965, the federal government still discriminated mainly on the basis of national origin in granting visas.
Nowadays, almost every nation puts restrictions on the number and type of people who can enter it, including the countries that send the greatest number of aliens to the U.S., and America's history of immigration does not justify making the U.S. the exception to that rule. However, the categorization of legal versus illegal is a creature of contemporary circumstance, not a platonic or eternal difference. We must know who is entering the country in order to secure it from terrorism and other crime and to prevent an unmanageable burden on infrastructure, concerns that were much less when the ancestors of the Minutemen & their sympathizers entered America. These are concerns, moreover, that the governments of immigrants' own nations have, and that therefore should be understandable by all as legitimate ones. Nonetheless, as long as both sides of the debate prefer to decontextualize -- the pro-undocumented immigrant side arguing for the return of the 19th century open door (without the racism) and the anti- side behaving as though their presence in the U.S. is owed to an antique H1 visa -- I doubt there will be any amicable resolution.