Why do we do drugs but have food? Or even have a beer, which is alcoholic beverage thus a sort of drug too. In both cases we consume something. Is there a rule for this?
Well, it gets even more curious than that. We can "have lunch" or we can "eat lunch" or we can even "do lunch":
Add to that phrases like:
This means "Give me/get me/hand me a beer."
There's really no rule you can apply to idiomatic expressions like these. Non-native speakers just have to learn them one by one, and they can be extremely vexing at times. It's enough to drive you to drink!