I lived in Morocco for 9 months and know this history very well. Morocco was a French colony until 1956 (called "French Morocco"), Western Sahara (called "Spanish Morocco") was a colony of Spain until I believe 1975, too lazy to search for it.
(Interestingly enough, the top part of Morocco near Tangier is heavily Spanish speaking, and during WWII you had an odd situation where French Morocco was divided between Vichy France and the Free French, and Spanish Morocco and the northern part of Morocco both were huge fans of Francisco Franco and wanted to stay out of the war entirely.)
In 1975, Spanish Morocco was granted independence by Spain, and King Hassan II claimed it, wanting to rejoin the country. (Thousands of Moroccan citizens marched from upper Morocco to the border in Laayoune to show their support.) However, this territory at this point considered its culture independent, and fought Hassan II's troops in a guerrilla war for the next 25 or so years.
Hassan II was a wonderful king. He was brutal, but I view him as Morocco's Pinochet. (As in, he was pro-West and had a bad habit of disappearing socialists - those that we know of were either executed or kept in secret prisons until they died. A major left-wing figure in Morocco's history, Mehdi Ben Barka, disappeared without a trace in Paris in 1965, and it's been concluded for years that there was no way he just disappeared.)
Hassan II also survived a few assassination attempts, one in particular where they tried to kill him on an airplane. He helped kill the assassins, and he then grabbed the radio's mic and said to their co-conspirators "We got him! The traitor is dead!" to throw them off before the authorities captured them.
As a result of all of this, I've always assumed that someone this based must be right on all accounts. Morocco is also very proudly nationalistic and flies their flag just about everywhere. If it wasn't for Hassan II, Morocco would have turned into a complete basket case like Algeria. (Tunisia, Egypt, and Libya have comparatively been a lot more unstable depending on the decade.)
Western Sahara is far better off as part of Morocco. Morocco already functions far better than the rest of North Africa, anyway, and the Western Sahara would become an Algerian satellite state living in squalor if they ever got independence. (Plus, the majority of the people living there don't really give a shit if they're their own country or not - the commie guerrillas living there just have a handle on everything there.)
I was actually dumb enough in Spring 2016 to want to visit the "Southern Provinces", what my Moroccan professors all called it. I was promptly told uh, no, you're a white guy who barely speaks Arabic and speaks even less French. The military will think you're some upstart reporter that's up to something, and you'll have to get bailed out of prison by us.
I lived in Morocco for about 9 months and one of my buddies lived in Casablanca. His father was a cop (former military) and owned three houses.
I assumed that he probably helped dig a mass grave or two and got compensated. As much as I support Morocco over Western Sahara in this case, King Hassan II was a pretty brutal guy who didn't hold back with this kind of stuff.
If WS ever got independence, they'd become a satellite state of Algeria, which has been antagonizing Morocco for the past few decades.