Being in a bad place has absolutely resulted in plenty of people turning to sex work and sleeping outside. I've had to do the latter completely sober.
Yeah drugs can make the situation worse, but it's really easy to be in a financially desperate position and turn to drugs to cope with what you're having to do to get through it.
The reality is that drug addiction, financial destitution, and homelessness are complicated and there are multiple categories of people in these positions. Drugs will often make the situation worse, and can be the incitement to the downward spiral, but for plenty the drugs are more of a symptom than a cause.