Alternatively, there could be some public space where it is legal to be homeless. The area could be fitted with bathrooms and other services.
The issues are that cities may be concerned about liability in that space and where you could put that space without angering some residents.
Additionally, a lot of homeless people would probably rather have their own space so they would reject a city sanctioned location for homeless people.
Unfortunately, it seems like an unlikely solution.