A guy told me he did the same thing with very different results. The woman thanked him excitedly when he gave her a bag of food. The reason the incident stuck with him was because he went back to his motel room feeling like a sucker that he couldn't just ignore her and flipped open the motel Bible at random and it instantly came to the Bible verse where Jesus said anything you do onto others you do onto him (that part is beside the point but I'm throwing it in just in case you're Christian).
I've given things to the homeless and worked with them in different ways and I've had plenty of good & bad experiences. I've never had your experience, though a friend of mine told me she was nearly attacked (and believes the only reason she wasn't was because she hit the gas pedal in her car and got away) when she offered some food (out her car window) to a guy with a sign "will work for food" (btw, this is known as "working the sign" and may or may not be honest).
I've offered food before but have been rejected. Actually that was only once, and she wasn't mean about it she just wasn't interested (which was when I knew she was lying about starving). I got more hostility from a 9/11 charity that was raising money for 9/11 victims and I donated food as I wasn't sure the charity wasn't a scam and whether I had them pegged right or they just found it inconvenient they were less than gracious about accepting my donations.
As for the homeless, I don't care if they spend money I give them on drugs (including legal ones) as I figure whatever makes their life easier (be it food or smokes or pot or whatever) is fine by me. I just don't like the ones who decide I'm a sucker and try to play me or act obnoxious (like acting like I'm obligated to give them money) in other ways.
When I was a runaway I was sometimes sent with the panhandlers as I was small for my age so we and other young kids, mostly girls, would sometimes take a bus uptown and panhandle at the mall as there were very generous people there, especially among the elderly. Usually we claimed to be kids who ran out of money who were hungry and needed bus fare (as saying we were runaways would get security and the police on us real fast, and even pretending to be irresponsible kids who just ran out of money was risky), and a couple of times someone would buy us food which we'd happily accept (after all that saved us from having to buy our own food) and I don't recall any of us being offended by it (we snatched up any free samples at the food court, too). Of course we were kids and unlike adults kids are USED to adults making choices for them, so maybe some adults would see it differently.
We really despised C-House (C=Covenant), too, because they reported our squats to the cops and anyone under 18 who went for help (even just medical) got the cops called on them (though the cops were often apathetic so it was sometimes possible to get away before they showed up nearly an hour later). Nevertheless they drove a van around that gave out free sack lunches and we very eagerly took what they offered (and at least I was grateful for it), though we were careful not to tell them anything we didn't want the cops to know.
Anyway, I don't think you did anything bad. You did good, it was him who was the jerk (possibly too mentally ill to function). And while I see BA's point, I'd think anyone who was reduced to begging for money would accept food as well (I know I would, even if I couldn't eat it for some reason I'm sure I'd know someone else or their pet who'd like it). Don't let one guy make you view an entire group that way.