Moroccan police checkpoints on intercity roads occasionally ask foreign travelers for ID, and hotels and riads are required by law to register your passport on arrival — having a physical photocopy (plus a photo of it saved offline on your phone) saves you from handing over the original unnecessarily and speeds up both situations.
It's equally useful to carry your riad's name, address, and phone number written down in both Latin script and, ideally, Arabic — showing this to a taxi driver or a local when you're lost in the medina gets you home far faster than trying to explain it in a language you don't speak. A small, low-effort habit that removes a real source of travel stress.