America, in the mid-1800s was a very racist country, with legal slavery and a long standing policy of extermination of Native Americans. What's more, due to large waves of Irish and German immigrants, a xenophobic (anti-foreigner) movement and political party began at that time. My point being that racial and ethnic tension didn't emerge at the time, but was rather embedded in society to begin with.
However, Manifest Destiny and the Gold Rush brought tens of thousands of Chinese immigrants to the west coast, California in particular, and as they looked differently, spoke a different language and were not Christian, they were very easy to discriminate against. Chinatowns on the west coast were simply anti-Asian segregation.
The large influx of miners and settlers in the newly conquered western territories pushed Natives off of their tribal lands and hunting grounds, so there was inevitable conflict between whites and the Sioux, Pawnee, Crow, Apache and Nez Perce tribes, among others, and anti-Native sentiment rose along with it.
Lastly, there was a great deal of tension between the Tejanos, Californios and white American settlers, who suddenly found that they occupied the same land and that Latinos had lost most of their rights to it.