If you envision a hypothetical city which has too many unhoused persons relative to the city's financial ability to support those people - then what? The unhoused just die in the street unable to be moved somewhere that has sufficient resources to support them?
I get that there's a lot more nuance to this problem and that the ruling can be abused/used to enforce NIMBYism/jail the unhoused, but, fundamentally, cities have to have the ability to move citizens because the city is aware of its own financial ability to provide support, but the citizens within are allowed to be uninformed.