Modesty is key, especially in developing countries. Until recently all women in Afghanistan had to cover themselves from head to toe by law. It is obvious to the locals if you are a Westerner but you’ll avoid most stares if you don’t look like a rich one that flaunts it. Having a scarf with you is good in Morocco and Egypt as well.
For one thing, I don't know what's more annoying, to associate Morocco to Afghanistan in the same paragraph, or Morocco to Egypt in the same sentence :p
But seriously, I pity the poor traveller taking that advice seriously In Morocco. At best it will win her amused stares, at worst annoyance. No gold star for the culturally sensitive traveller, too bad.
So let's get this sorted. To interpret and dress for the occasion is a basic social skill, true for everyone everywhere. Everyone knows that what you wear for a job interview, for slouching at home, for clubbing are not interchangeable, that a swimsuit is OK on the beach, not so down-town etc.. So why the hell everyone assume that what a scarf, veil, whatever you chose to call it, means the same in Paris, Casablanca, Cairo or Kuala Lumpur?
Actually I can't think of anything more versatile...
In Europe, it's seen generally as a sign of being a practising Muslim, and specifically as a sympathizer to some kind of political Islam. It's probably true, or mostly true, most of the time. Meanwhile, other minority Hijabs are conveniently ignored or lazily misinterpreted.
A long time ago a came across this caricature classifying types of Syrian Hijab.
Some of them are lost on me, not being familiar enough with Syrian society, others are common in Morocco too. But to give an example to what some scarf-dress-attitude combinations might mean in a Moroccan context:
Ok guys, now I want to settle down and get married, serious prospective husbands only.
Brr! It's freezing!
I really need to find time for the hairdresser
I just can't believe I found the perfect shade of blue to go with the hand bag and the shoes, wait until Samira see it
Too bad guys, I'm off market now, I just got married.
So clean, so smooth, that Hammam session was so good and this double protection is draught proof.
Do I have enough Shuriken?
Seriously, a dress code is a language of a sort, if you just pick any word combination of in a foreign language, you end up talking gibberish. Incidentally, scarf wearing female tourist is screaming: I'm ignorant, well intended, but still ignorant.
My advice if you're a female tourist in Morocco , wear something your fiancé won't feel embarrassed presenting you to his parent in it. Simple right?