Although people came here legally through federal government channels (pre-Civil War: individual states had the right to decide immigration policies and quotas), immigrants had zero rights.
Chinese immigrants could only work certain jobs, could not own property (see Chinese Exclusion Act), and were paid next to nothing working hard labor through railroad and mining companies.
The Federal government gave immigrants very few rights or opportunities. They were paid less for doing the same work in factories as American-born citizens (see Nativism) and told that if they did not adopt U.S. culture they would never survive (similar to the forced assimilation of Native Americans). Italian, Irish, & German immigrants were blamed for the rise of corrupt politicians and organized crime. This was because these manipulative groups were the only ones giving immigrants the welfare they needed so the immigrants supported them for the sake of their families.
Theses groups were also used as scapegoats during the rise of both the temperance movement and strikes protesting workplace accidents. When factory workers had a colleague die on the job, the factory owners would spin the blame on immigrants drinking around the machinery so they would not have to fix safety regulations.
Despite exceptions like Jane Addams and Upton Sinclair, many Americans believed in "Social Darwinism" and that immigrants/lower class people would never be able to change their situation because of their background, so changing laws to help them was not a priority.