Accurate or not, the perception most have about immigration to the United States before the middle of the 20th century was that people just showed up at Ellis Island (or another port of entry), they were asked some basic questions by an immigration officer, and they were allowed into the country. This doesn't mean that these immigrants immediately became citizens, obviously, but the doors to the country were evidently quite wide open at one point. Is this accurate? If so, what signaled the change to a more restrictive policy, and what drove that change?
During the first century (and change) of American independence, it had a vast open frontier and minimal government-supported public services. An immigrant could only be a net positive economic contributor, and immigration policy was accordingly permissive, although non-white immigration was carefully constrained.
As the frontier began to close, agriculture to industrialize, and government services became more extensive and expensive, immigration ceased to have so obvious an economic benefit that it could suppress nationalism / ethno-centrism and labor protectionism, and immigration began to be restrained, first for non-whites (the Chinese Exclusion Act in the 1880s, e.g.) and by the 1920s even for most whites. This situation persisted for 40 years until the Immigration Act of 1965, which created a dramatically new and different regime for immigration, including (importantly) facilitating large-scale permanent immigration, with no fixed disadvantage for non-white immigration, that had been prohibited in all but exceptional cases. Large-scale immigration, mostly illegal, from Mexico and Latin America began to accelerate at that time, fueled by three things -- economic instability in their homelands, American citizen labor becoming extremely extensive, and a legal/political civil rights movements which denied states and localities the ability to discourage illegal immigrants (for example, by depriving them of access to public schools or health care services).