Even without the water, the fact that you are practically on the moon out in the deserts of Africa makes any sort of operation difficult enough. It's probably much less of a headache to just open a nuclear power plant on the morrocan coast than to do anything that produces a similar amount of power out in the morrocan desert, where there might not be any roads let alone a grade separated freeway and a freight rail network connected to every port on the continent, as is the case even in some of the more desolate parts of the U.S..
A nuclear plant would let Morocco more dependent (expertise and combustible). Multiple intents to obtain uranium (either by mining it, as early as in the 1940's, or as a by-product of phosphate mining) aborted. Selling claims to foreign companies is less risky and is the path followed by Morocco.
A solar farm isn't a plant, there is no real permanent need for heavy-duty infrastructure: it needs few input (no energy nor raw matter, and most spare parts can be stored in the farm) and a set of power-line conveys its sole output, no need for freight trains/trucks.
Moreover Morocco's South is quite different from the average subsaharian desert. There are transport infrastructures, a very pertinent expressway (A3: Casablanca-Marrakesh-Agadir), ports (especially at Laâyoune), even airports (Dakhla can accommodate a Boeing 737). There are serious mining operations, see for example Phosboucraa. Some infra was created by French colons in order to exploit mines and is more-or-less maintained and extended.