Is an eSIM better than buying a local SIM at a Moroccan airport?

For most visitors, yes: no queue or passport registration, it works the moment you land, and your home SIM stays in your phone.