Like others have said, this is a really complicated topic full of a lot of grey areas.
Would I love to be able to give every homeless person I see money? Yeah. I'd also love to be able to give them a place to live and food to eat, but unfortunately I can't. I've been homeless before - thankfully I was fortunate enough to be in a homeless shelter vs out on the streets, so my heart really goes out to homeless people because it's terrible. It sucked when I was homeless and I can't even imagine what it would be like to be out in the cold or the boiling heat without your belongings or food or anything.
That all being said, I rarely give money to homeless people on the streets. The reason being that as a smallish female I don't feel safe doing so. If I see homeless people on the street I'll cross the road, keep my head down, just ignore them. Because they can be unsettling, especially if they are under the influence of drugs or alcohol. The people who were with me in the homeless shelter were unsettling already - people on the streets are typically worse off and their emotions reflect that. When going through withdrawals of any kind or just being starving people can get irritable and irrational and I'd hate to be on the receiving end of them lashing out because I haven't given them enough money, etc.
Out of the options I prefer to just give them money vs food, or clothing, or whatever else. I know the rationale behind giving them food but like others have said - if they are addicts not having access to whatever they're addicted to can kill them and not being given what they want can also make them upset which could put myself in a dangerous situation.
It's terrible that people panhandle when they don't truly need money and that can also complicate things. I wish I was rich enough to just be able to hand out money to everybody because it's hard to tell the difference between people genuinely in need vs those who are scamming and it sucks that because liars are out their the genuinely hurting people don't get as much help.
I feel like this is one of those situations where there isn't really a wrong answer. If you have the means and are able to donate money (or food or clothes if that's what they'd prefer) to homeless people than that's wonderful! But I don't think choosing not to or being unable to makes you a bad person, either. I'll donate money, food, and clothes to charities when I can but I also know that those organizations aren't available to all homeless people so it's really complicated. I really wish the government would do more to help with the increasing homeless population. :/