I believe you are not comparing like for like. The better resorts in Egypt are similar in price to the better resorts in Morocco, and the fashionable residential complexes under construction in Cairo are more expensive (although better quality) than anything I have seen in Marrakech, Rabat or Casablanca.
To my knowledge there is no VAT on property purchase in Egypt as one reason. The Moroccans have been spoilt by the French as they have been buying in Morocco long before Egypt came on the scene.
Funny thing is, that is what put me off Egypt, it was too cheap (same with Bulgaria) now though having been to Eygpt I may consider it again as cheap property can still be bought and may be worth a punt Although I would not touch Bulgaria with a bargepole.