Why not? We encourage other people to do things all the time. I certainly encourage people to vaccinate their kids. Donating money to people who will immediately spend it on substance abuse is harmful to them. You're making yourself feel better about how you're SUCH a compassionate person at their long-term expense.
I laugh at people going, "b-b-but they're still human!!!" Like, do you donate cash on the street to non-homeless/non-panhandlers too? Yeah they're still human, why does that mean it's bad if I think about what they'll use my money for before >>donating<< it? Now if they want to earn money by working for me in some capacity, sure, they can spend it however they want. That's a completely different type of transaction.
We're not talking about Pareto-optimal market transactions here; the externalities are the point of giving money away or not giving money away. So it's an interesting position, telling me I am "wrong" for being concerned about whether one is purposefully helping or harming others. It's probably a good thing that most of the world does not share your interesting perspective.
Where you lose people is telling other people that they're wrong to give cash to homeless people.
What's worse is, this thread kicked off with someone laying out in very simple terms --- terms you didn't really address --- the logic behind giving money on the street despite not knowing the purposes to which the money would be put.
You can argue however you want, including that people are wrong to give money on the street, and that it's not OK for them to give to homeless people or buy ferrets or whatever. But you shouldn't act hurt when people argue back at you.