Your dehumanizing statement used "illegal" as a noun. If "illegal" is being used as a noun (e.g., referring to a person who entered a country illegally), then whether to use "a" or "an" depends on pronunciation, not meaning or part of speech. Correct: "an illegal" Incorrect: "a illegal"