Alcohol is legal in Morocco and available, but it is not part of public life. Licensed hotels, riads, and mid-to-upper-range restaurants serve wine and beer; Morocco makes decent wine of its own, mostly around Meknes. Supermarkets in the new cities have a section for it. What you will not generally find is alcohol in medina restaurants, in small towns, or anywhere near a mosque, and drinking in the street is not done.
Two practical notes. During Ramadan, service to Muslims stops and many venues suspend alcohol entirely — if that matters to your trip, ask us before you book those dates. And if you want a riad with a bar or a wine list, say so at the enquiry stage; it genuinely narrows the list, and it is easier to filter for at the start than to fix later.