Al-Hakim (pictured here) was born in Egypt, and succeeded his father at the age of eleven. Rumors that he was the offspring of his father and a Christian consort—and the desire to eliminate the "taint" of Christianity, might have been the motive for destroying the hospital, the Church of the Holy Sepulchre, as well as a reported 3000 other buildings in Jerusalem.
Of course, becoming caliph at eleven could also instill the notion that you can do whatever you want. Not only that, a religion sprang up around him. He was considered God made flesh in the burgeoning Druze religion.
To be fair, he became kinder in is later years—not too much later, since he lived only until 35. He embraced asceticism and frequently took to meditation. Then, on a February evening in 1021, the man who had been called "the mad caliph" set out on a journey but never arrived at his destination. A search found his donkey and bloodstained garments. No explanation has been found, and there is no evidence to support the rumor that his sister had a hand in it. She assumed temporary control of the court, pushed out Al-Hakim's chosen successor, and pushed for Al-Hakim's son to succeed as caliph.
That son was Al-Zahir li-i'zaz Din Allah (20 June 1005-13 June 1036). One of his changes was to delegate more responsibility to court officials, which started a trend that would make the caliphs less and less powerful over the years. Al-Zahir allowed the rebuilding of the aforementioned hospital in Jerusalem. He also tried to eliminate the Druze religion. It didn't work, and the Druze religion—little known, but millions strong even to this day—might as well be the next topic.