The natural inclination of local jurisdictions would be to count all carbon based life forms, alien or not, as well as the dead (to accommodate Democrats), in order to inflate their numbers for congressional apportionment and various federal and state subsidies. That, however, doesn't mean that illegals MUST be counted. The court may have merely ruled that the constitution doesn't prohibit counting them, so if a state, or the Congress, wants to do otherwise, it can legislate to that effect.
Although the Court's decision was unanimous, there were actually two opinions: the majority (Ginsburg, Roberts, Kennedy, Breyer, Sotomayor and Kagan) said "must be," and the concurring judges (Thomas and Alito) said "can be." Made no difference in this case, because Texas chooses to count all residents, legal or otherwise, so even Thomas and Alito voted to uphold the Texas law.