The United States Constitution says nothing about immigration. Its creators left it to individual states to regulate the influx of newcomers to these shores.
New York, with the highest number of immigrant arrivals, took the lead in establishing guidelines. The first regulations were meant to weed out those who could not support themselves and those with contagious diseases.
As immigration grew, the federal government took more responsibility for regulating it. The first national law was enacted in 1875. It primarily excluded criminals. After the huge influx of immigrants between 1880 and 1920, the government set quotas from each country of the world based on the number of people of that ancestry already living in the U.S. This policy favored northern Europeans and greatly reduced the number of immigrants from other nations. Since then, the restrictions on immigration have sometimes been tighter and sometimes looser, depending in part on the U.S. economy. One result of strict regulation has been to create a large population of illegal aliens. Those are people looking for a better life who manage to enter the U.S., even though they are not qualified for legal immigration. Most live in fear of being sent back to their native countries.