I have a friend who has a large, comfortable air conditioned villa in Marrakech with a large pool in the garden. I made the mistake of going there for 4 days 2 years ago in August. I wilt in the heat in any case and could've kicked myself. I basically spent 4 boring days indoors keeping cool and watching Arabic TV stations. For me, it was too hot even in the evenings, although we did go out, of course. It's an experience I shall never repeat. And I did it to myself knowing the horror I'd be experiencing - 10 years before I'd been at the Semiramis in Marrakech in August with posh Moroccan friends and had said then, after a week spent in the room, "Never again".
That's just me, of course. If you like the heat, then maybe Marrakech in August is the place for you! It's right that many people leave in August, even Moroccans, but there are some who like it.