To the degree that its viewed as the third place in sanctity after Mecca and Medina, the question is more obvious when everybody knows that Jerusalem is not mentioned in the quran even once by either of its names, meaning Al-Quds (القدس) and Bayt Al-Maqdis (بيت المقدس), or Elia which is short for Aelia Capitolina (Eliyya Qappitolina)and Uru-Shalem keshenem, (Spelling?).
How Jerusalem became so holy for Muslims? Since the quran does not mention Jerusalem, we have to go to the hadith, the secondary oral tradition. There we find many things about Jerusalem. First of all, Muhammed, the prophet of Islam, used Jerusalem as a direction for his prayer for a year and a half when he was in Medina after 632, after he emigrated to Medina. He tried to drag three groups of Jews who were living near Medina by directing his prayers towards Jerusalem, just like them. They didnt buy this. He got angry with them. He slaughtered them and took the women, wives and girls, even one of his wives was Jewish from that tribe. After there were no more Jews, so there was no point to pray to Jerusalem, he turned the prayer to the south, to Mecca thus turning his back to Jerusalem claiming that the kaabah, the idol of the Arabs for a century before Islam, is actually a stone, a gift which allah gave to Abraham as a reward for his willing to sacrifice his son, Ishmael. Everybody understands where this story came from. This Jerusalem finished its role in Islam.
Doing things in the way of Mohammed, there were near, not far from Mecca, a village named Al Gwei'iyyah Near this village there were two mosques one was closer and was named masjid al madna, the other one was a bit far from the village and was called al masjid Al-Aqsa (means the further mosque). Everybody knew that. Prophet Mohammed even prayed in these mosques, masjid al madna & al-masjid Al-Aqsa.
In the quran it mentions that allah took his servant at night from the holy mosque, which is in Mecca, to the further mosque in this further village, Al Gwei'iyyah and there allah showed him his wonders. This is chapter 17, verse 1.
After Mohammed passed away, the caliphs gradually moved the Islamic capital to Damascus, thus leaving Mecca as a remote place, only a place for pilgrimage. In the year of 682, fifty years after the prophet passed away, there was a rebellion in Mecca, because of various reasons. Mainly because of the moral level of the behavior of the people in Damascus who were behaving freely with the wives of the mujahideen, those who were fighting in Persia and those towards Spain in the west. Since they went to Mecca every year, in order to cleanse their sins, somebody from Mecca, named Abdella abuZubair declared a rebellion against the caliph and against those who lived in Damascus and prevented them from coming to Mecca to clean their sins in Mecca.
So the caliph, since he could not do anything about this because he had no soldiers, at that time, in the year of 682, because the soldiers were fighting in Persia and Morocco, he, for eight years, looked for another place, an alternative place for pilgrimage. So, if Jerusalem was holy for Jews and Christians- let is also be holy for Muslims. Then they took this story about allah which took his servant from the holy mosque to Al-Aqsa mosque, and they imported the Al-Aqsa mosque to Jerusalem and said that Jerusalem is their Al-Aqsa mosque, the real one, and concocted a whole series of stories how Jerusalem is holier than Mecca only in order to establish the idea that the pilgrimage should be to Jerusalem and not to Mecca.
Of course this was a lie, this was a whole bunch of concoctions. These stories which the ulama, the wise people of the caliph made up those days. are Islamic scholars like Ibn Taymyyah who knew about this and tried to put Jerusalem in its original status, which is like every other city. However, since it was a political issue it is a political issue until today. By the way, Saladin in the twelfth century also used these stories to enflame his soldiers against the Christian Crusaders towards the end of the twelfth century.
Today, also, Jerusalem is nothing but a political issue which is colored by religion no more, after all religion and politics in Islam are the two sides of the same coin.
Great post