There's nothing wrong with giving a stranger money, but I think a dollar or 2 would be my limit. I've purchased a sandwich and a soda for someone who says he's hungry, but I can't imagine giving away thousands, not even to somebody I know.
Anyway, I agree it was very stupid. However, I do feel sorry for this person, even if he is a fool.