Mexican immigration issues began around the end of the Mexican-American war in 1846. The war was over Texas, which had declared its independence from Mexico to become its own “Lone Star” republic in 1836.
Over the next ten years, it would appeal to join the United States, which would eventually annex Texas, largely because the Mexicans killed Davey Crocket at the Alamo. This prompted a war and resulted in a new border at the Rio Grande.
Border crossings between the two nations were still pretty much open and unobstructed. The United States was eager for population growth, given its vast territorial resources and settlements and its ambition to develop them. The southwest was still largely dominated by Mexicans and the peso was the preferred currency; the dollar was still a laughable upstart out west, along with foot-high stovepipe hats. (Western settlers looked like Daniel Day-Lewis in Gangs of New York.)
According to the Cato Institute, U.S. immigration history was a long series of pragmatic moves:
Looking back a few decades before the Mexican-American conflict, many of the Founding Fathers were concerned about Catholicism, alien voting rights, non-English languages and cultural diversity reorienting the strong white protestant ethic. But Thomas Jefferson summarized their official position when he stated that “the present desire of America is to produce rapid population, by as many importations of foreigners as possible.”