The answer lies in its name. King Hassan has never shied away from the cult of personality. The mosque is called after him and is destined to be his own mausoleum. His father, Muhammad V, built a great shrine to himself in Rabat. His son has merely outshone him.
The mosque, which was opened in Casablanca yesterday, is undoubtedly magnificent. Its minaret is higher than that ancient mausoleum to a dead king, the pyramid of Cheops in Giza. Its prayer hall is three times larger than St Paul's cathedral. Turquoise tiles adorn its sides. Its great open spaces are paved with gleaming marble. A laser beam on top of the 700ft-high minaret can be seen 30 miles out to sea.
There is some controversy over the way the mosque was financed. Government employees had their 'donations' deducted from their pay at source. Private businessmen were cajoled into coughing up more if their original contributions were considered too modest. Even Moroccans living abroad were targeted on their return home.
King Hassan has a sense of occasion as well as theatre. The mosque opened on the feast of the birthday of the Prophet Muhammad. Yet though the motive behind its construction may be monstrous vanity and egoism, it will serve a purpose. The mosque was built in one of the poorer areas of the city, but will not be an empty tomb-in-waiting. It will provide a place of worship for at least 25,000 people and will give Casablanca, Morocco's main commercial centre (although the administrative capital is in Rabat), the kind of great building that it lacks.
The mosque also helps to underline one of the important differences between Morocco and other states in the region. The country's stability is not at present shaken by the kind of militant Islamic movement that afflicts other regimes in North Africa. The security forces keep a watchful eye on any such nascent trends. A small group opposes the king's claim to be Emir al-Muminin - Commander of the Faithful. But a principal source of the country's stability is King Hassan himself. He alone can unify the disparate groups within the kingdom. And he enjoys his dual role as temporal ruler and religious leader, never wasting an opportunity to emphasise his own religious credentials as a sharif, a descendant of the family of the Prophet Muhammad. This not only helps keep the loyalty of traditional elements within Moroccan society, but also makes potential Islamic militants think twice before challenging his rule. The new mosque will be a large and potent reminder of his spiritual role.