Under what legal theory is the citizenship question “illegal”??
It is constitutional to include questions in the decennial census beyond those concerning a simple count of the number of people. On numerous occasions, the courts have said the Constitution gives Congress the authority to collect statistics in the census.
As early as 1870, the Supreme Court characterized as unquestionable the power of Congress to require both an enumeration and the collection of statistics in the census.
The Legal Tender Cases, Tex.1870; 12 Wall., U.S., 457, 536, 20 L.Ed. 287. In 1901, a District Court said the Constitution’s census clause (Art. 1, Sec. 2, Clause 3) is not limited to a headcount of the population and “does not prohibit the gathering of other statistics, if ‘necessary and proper,’ for the intelligent exercise of other powers enumerated in the constitution, and in such case there could be no objection to acquiring this information through the same machinery by which the population is enumerated.” United States v. Moriarity, 106 F. 886, 891 (S.D.N.Y.1901).
https://www.census.gov/2010census/about/constitutional.php