Homelessness/drugs/prostitution has splash and fallout damage to people directly involved and others such as disease-spreading, burgleries, and mental/physical damage. Having laws against them is just one way mitigate or minimize that damage, but of course dealing with the underlying cause should work better, but our country is not sympathetic to that kind of social spending.
So we have a continual cycle of crime-punishment that doesn't mitigate enough, simply because the underlying problems remain, until our country stops with the "you're on your own" mentality and starts supporting social programs better.