The water is pretty drinkable in Morocco for those with a tough stomach but those prone to diarrhea should stick to the bottled stuff. Muslims keep their food pretty clean but you may want to be careful of street snacks that have been sitting around in the sun for too long.
Whilst Morocco has a strong tradition of hospitality it can also be quite rough. There are street gangs and the odd roaming drunk who might want to pick on a foreigner. It’s not rare for young guys to carry knives in self-defence and there are areas you don’t want to be walking around at night unless you have a local friend with you.
Moroccans can be very welcoming but also very volatile. With the population explosion and economic exclusion from Europe, there’s a lot of bitterness towards tourists and if you provoke them they’ll download it all on you. Stay calm even when they shout in your face.
The border areas with Algeria and Mauritania are pretty wild. Don’t go there unless you know what you’re doing.
For more on staying safe check out the Travel Health Guide