The only Mosque that non-Muslims can visit in Morocco is the huge Hassan II Mosque in Casablanca (but only with a guided tour). This is the law in Morocco (the dates back to the French occupation). although there are few travelers getting a cheeky look in to one or two (usually in the middle of nowhere and with a bribe most probably), but other than that Mosques are a definite no go for non-Muslims.