I normally buy a 3G dongle when in Morocco (250dh or less for a month), but this time I spent the first five weeks using free wifi (pronounced wee-fee) at cafes and hotels. Many cafes have a universal wifi sign outside. The only place in Morocco I had difficulty in finding free cafes was Ouarzazate but the new CTM bus station has a cafe with wifi.
What you might find is that hotel wifi doesn't extend much beyond reception.
If you are planning to take your own notebook PC stick a cloth between the screen and keyboard otherwise the constant vibration (if riding offroad) will etch the key images into the screen.