I have friends (U.S. Citizens) who are married to foreign nationals. As part of the application process for an immigrant visa, they are required to produce a clean police record and show financial means or skills for self-support or have a guarantee from their spouse of such support. This are the very basic of a number of logical requirements.
Illegal immigrants, of course, do none of this-- they simply wade a river, climb a fence or pay a coyote. Even during the 1870-1910 era of massive legal immigration, many were turned away at Ellis Island for any number of reasons-- TB, insanity and other health-related ailments being the most common.