Morocco is a very child-friendly country, but men and women (and mothers) play a different role in society to what we might be used to at home. For example, you will generally see more men in public life than women, especially in the majority of cafes (which might be a venue where a mum might normally breastfeed at home).
Moroccan women are extremely discreet if they breastfeed in public and a tourist doing so might attract unwanted attention, although in general in Morocco mothers are treated with great respect and people will typically avert their gaze. Breastfeeding mothers would probably feel least on display in a hotel or restaurant, or in a place where there are only women (eg in a family home). Carry a scarf or muslin to ensure minimum exposure!
For more tips on travelling with a baby in Morocco, see this post.