There are not laws that prevent a citizen from marrying a foreign national who is unlawfully present in the U.S. It is unlikely that an undocumented immigrant would have the identification required by state law, such as a SS#.
Be that as it may, the citizen spouse would not be able to file an application for the non-citizen spouse's permanent resident status, because he was in the country illegally. The non-citizen spouse must return to Mexico and the required USCIS laws must be followed before he can legally reenter the U.S. United States Citizenship and Immigration Services, http://www.uscis.gov
Neila222