You’ll need to be reasonably self-sufficient to cycle in Morocco.
Moroccans are not terribly enthusiastic about cycling on the whole and as a result high quality bicycle parts are hard, if not impossible, to come by. You’re unlikely to find much beyond Chinese imports and basic repair services.
Forget about flying into the country and buying a bike on the spot. You’re better off to get one across the water in Spain and then take a ferry to Morocco.
If you have any high-tech parts on your bike like disc brakes give your bike an extra check-up before you leave and come prepared with the relevant spare parts.
It is possible to find camping gas cartridges in Morocco but other types of camping equipment are as hard to find as a decent bicycle shop.