You are referring to McCarran-Walter Act
of the United States Code (8 U.S.C. ch. 12). The Act governs primarily [immigration to] and
citizenship in the United States.
The Act allowed the government to make sure only [desirable immigrants] let into the U.S.,
the ones that where [deemed harmfull] where not even let in, or deported if found here.
https://en.wikipedia.org/wiki/Immigration_and_Nationality_Act_of_1952
Eventually, the Act established a preference system which determined which ethnic
groups were [desirable immigrants] and placed great importance on labor qualifications.
The Act defined three types of immigrants: immigrants with special skills or relatives of U.S.
citizens who were exempt from quotas and who were to be admitted without restrictions;
average immigrants whose numbers were not supposed to exceed 270,000 per year; and refugees.
-so if you where not on the list above, and deemed hostile to our ways,
or was not in the U.S. interests , no entry was allowed.
The Act [also]allowed the government to deport immigrants or naturalized citizens engaged in sub-
versive activities and also allowed the barring of suspected subversives from entering the country.
The Immigration and Nationality Act of 1952 requires an alien to apply for a petition for naturalization.
This form may be obtained from any office of the Immigration and Naturalization Service, a division
of the Department of Justice, or from any court authorized to naturalize aliens.
Before applying, an alien must be at least 18 years old and must have been lawfully
admitted to live permanently in the United States.
He must be of good moral character and "attached to the principles of the Constitution".