Scholars debate the relative strength of economic and ‘socio-psychological’ sources of anti-immigrant sentiment. However, the literature often fails to distinguish legal from illegal immigration and therefore overlooks a major instance in which this debate is moot. To address this issue, we develop a theory that recognizes two different modes of evaluating immigrants: “attribute-based” judgment, in which respondents weigh immigrants’ desirability based on individual characteristics—human capital, race, language ability, and so on—and “categorical” judgment, which disregards these altogether. Categorical judgments arise when a policy issue triggers blanket considerations of justice or principle that obviate considerations about putative beneficiaries’ individual merits, instead evoking overriding beliefs about the desirability of the policy as a whole or casting the entire category as uniformly deserving or undeserving. We use experimental evidence from two national surveys to show that the principal distinction between attitudes toward legal and illegal immigration is not in the relative weight of immigrants’ attributes but the much greater prevalence of categorical assessments of illegal immigration policy, much of it rooted in rigid moralistic convictions about the importance of strict adherence to rules and laws.