Not because they live in cities (a common misuse of "cosmopolitan"), but because this is their range:
"Cosmopolitan" refers to a citizen ("polites") of the "kosmos" (in Greek times "the world" - not the universe).
The term "cosmopolitan distribution" usually should not be taken literally, because it often is applied loosely in various contexts. Commonly the intention is not to include polar regions, extreme altitudes, oceans, deserts, or small, isolated islands. For example, the housefly is nearly as cosmopolitan as any animal species, but it is neither oceanic nor polar in its distribution. Again, the term "cosmopolitan weed" implies no more than that the plant in question occurs on all continents except Antarctica; it is not meant to suggest that it covers the continents entirely.Map credit.