The U.S. Constitution mandates a census count every ten years for the purposes of political apportionment. Specifically, how the seats in the U.S. House of Representatives are divvied up among the various states.
The census count is also used by the various states to draw their own political lines. Here in North Dakota, our lawmakers will commence redistricting once the 2020 census count is finalized.
But the Constitution doesn’t limit apportionment to citizens. Article I, Section 2 of our nation’s founding document originally stated that House seats shall be divided among the various states according to their “numbers” and that “numbers” means a count of the “free people” living there. That was later changed by the 14th Amendment, section 2 of which states: “Representatives shall be apportioned among the several states according to their respective numbers, counting the whole number of persons in each state, excluding Indians not taxed.”
You’ll note that nowhere in there is a reference to citizenship. Which is why the U.S. Census counts everyone in the country, including citizens and legal visitors and illegal immigrants.