There are two national languages in Morocco: standard Arabic and Amazigh. or Berber. These are the languages you will see on highway signs, for instance. The Berbers were there first, more than 10,000 years ago. Digest that time span, that's a hundred centuries ago. They have a unique alphabet, it looks old. In modern Morocco about 30-40% of the population still speak Amazigh.
And then of course there is French. The language of the colonizers (1912 - 1956), French is a sort of prestige language, associated with a good education and formality. Most universities in Morocco use French as their lingua franca.
What is fascinating is that none of these languages: Amazigh, Arabic or French, is the common language spoken on the streets. This is the domain of Darijah, a spoken language that has no natural script. Darijah is a combination of all three: Amazigh, Arabic and French. It is not intelligible to speakers of pure Arabic or French.
Thus a typical Moroccan speaks at least 3 languages, and I'm not even counting Spanish or English, which are also prevalent. Think about what that does for your identity and breadth of cultural affiliation. The truth is that this sort of linguistic glut is common in post colonial Africa, where national boundaries were imposed over linguistic divisions. South Africa has eleven national languages, for example. I think it is part of why Moroccans are so hospitable: their common language is intrinsically a mixture of cultures spanning thousands of years.