I don't have the data to back this up, but from what I've heard it is not unusual to drink alcohol in some predominantly Muslim countries like Turkey. Despite that, I agree with you that there are definitely more factors at play than just the law.
It's free to drink here, but drugs are banned. Only a very small minority drinks alcohol in my region, I have no relatives I know of that ever drank. Drugs/weed/marijuana are horrible things no one ever wants in my entire social circle, I don't think I have ever seen a user of such substances in my entire life IRL. Western and some coastal cities drink more and there's more drug activity too (and they're less religious too).