Same. A homeless guy walked by an alley near my house once and asked for money for food. I walked inside and came out with a half-dozen cans of tuna for him, and he started swearing and saying he didn't want "that cat food". I just stared at him, said "I eat this stuff. If you don't want it, then nothing for you." The guy just flipped me off and walked away. Good deed averted.
You did the right thing; that person was trying to score. I also offer them food only. If they don't accept it, it's usually because they are junkies and want someone to extend their habit.