Take Section 9 housing. Originally, it was setup for everyone to live in, with the idea that tenants would have the skill to maintain their housing,and local governments would provide funding.
However, what happened is that suburbs got built and setup rules so only whites could get loans & move there. The feds dramatically subsidized building these suburbs (billions in roads, sewage, etc), so the buying cost for houses in suburbia was massively low relative to true cost. So the whites moved to the suburbs on the basis of good personal economics (via gov subsidy and cheap credit) and good marketing (suburb developers sold the dream).
The suburbs thus became politically powerful (white & somewhat wealthy now, bc of subsidized housing). Suburbs didn't want (and still don't) want to pay for city expenses, but since suburbs are generally part of the same municipality, they could use their political power to cripple inner city services. Which they did.
Then the urbanites (mostly not white, bc suburbs where racially zoned) gradually became destitute as businesses couldn't survive without adequate services. And with destitution we see the rise of homelessness, drugs, etc that you rightfully point out.
Seems like it's high time to recognize the calamitous mistake and fix it
Right now the burbs are able to zone out or otherwise not have to deal with homeless, poverty, subsidized households, and lock in local tax revenue to high earners. As such burbs are the only good individual choice
However, I do think there is a growing body of urbanites who are pushing for change. California recently passed SB9, hopefully the first of many densification bills.
Perhaps if a leader-state like California gets far enough down the road for the economic benefits to start accelerating, greed will work in the urbanists' favor
But yeah to your point I don't think homeless prompted people to leave urban areas, people leaving urban areas caused homelessness. The causality is reversed, is my point.
The reason people left, as alluded to above, was largely government subsidy + good marketing/lobbying by suburb developers, auto companies, and road builders.