Why did God order the construction of the Ka'bah and what was the main purpose behind its construction?

Question:
Why did God order the construction of the Ka'bah and what was the main purpose behind its construction?


Answer:
Based on Quranic verses, traditions and historical documents, Ka'bah and Mecca are symbols of divine blessings, human guidance and a place of congregation for servitude to God who bestowed profuse blessing and good upon this place which used to be dry and infertile before it. By showing the reality that it is a place for attaining divine proximity, He showed the people of the world how one can tread the path of guidance and salvation. God, the Exalted, prescribes a series of actions to be performed on specific days, actions that signify human beings' servitude to Him. They are actions that require men to abandon his carnal desires, clean himself from all kinds of impurities, inclinations, colors and ungodly modes of living. He should therefore turn to God sincerely; seek repentance and proximity to God. In addition, He introduced His house as the station (maqam) of Ibrahim, a sacred sanctuary and a pilgrimage site for those who can afford. Each of these is a sign of God's greatness. The congregation of hundreds of thousands of people from across the world at this place and their performing special rituals and demonstrating their servitude to God are some of the greatest signs that are very influential and awakening for other people of the world. God ordered the Ka'bah to be built so that people may turn to it for prayers, for slaughtering animals and placing the dead with their faces in its direction. All these are aimed at making people remember Him. In addition, God wants all the apparently scattered hearts and minds to turn towards a single direction so as to cultivate the spirit of monotheism and oneness in them and to revive His own religion thereof.
Therefore, the object of building such a holy place is not but establishing a symbol and a sign for spiritual and metaphysical issues.

Detailed Answer
Based on Quranic verses, traditions and historical documents, Ka'bah and Mecca are symbols of divine blessings, human guidance [1] and a place of congregation [2] for servitude to God who bestowed profuse blessing and good upon this place which was dry and infertile before it. [3] By showing the reality that it is a place for attaining divine proximity, He showed the people of the world how He sustains them and how one can tread the path of guidance and salvation. God, the Exalted, prescribes a series of actions to be performed on specific days, actions that signify human beings' servitude to Him. They are actions that require men to abandon his carnal desires, clean himself from all kinds of impurities, inclinations, colors and ungodly modes of living. He should therefore turn to God sincerely, seek repentance and proximity to God. [4] In addition, He introduced His house as the station (maqam) of Ibrahim, a sacred sanctuary and a pilgrimage site for those who can afford each of which is a sign of God's greatness. The congregation of hundreds of thousands of people from across the world at this place and their performing special rituals and demonstrating their servitude to God are some of the greatest signs that are very influential and awakening for other people of the world. [5]
God ordered the Ka'bah to be built so that people may turn to it for prayers, for slaughtering animals and placing the dead with their faces in its direction. All these are aimed at making people remember Him. In addition, God wants all the apparently scattered hearts and minds to turn towards a single direction so as to cultivate the spirit of monotheism and oneness in them and to revive His own religion thereof. [6]
Therefore, the object of building such a holy place is not but establishing a symbol and a sign for spiritual and metaphysical issues.
The Holy Quran points out the purpose behind the construction of this House and its background. It says:
"The first House (of worship) appointed for men was that at Bakka: Full of blessing and of guidance for all kinds of beings." [7]
Here we will cursorily point some of the aims and benefits of the construction of Ka'bah:
1. Creating an Islamic Power Base
Imam Sadiq (a) has been narrated as having said: "Without doubt, God, the Glorified, created man and ordered him to follow religious injunctions. He fixed their worldly expedience and in line with this, He appointed the Ka'bah as a center of Muslims' congregation and power so that they may converge there from all over the world." [8]
In another narration from Imam Sadiq (a), he has been narrated as having said: "If the tribes suffice to their own regions only and to what is in them and if they suffice to what they have, the lands will get destroyed, the business will perish and that country will face a cultural setback. [9]
2. Creating a Revered Center
It is necessary to have a stronghold and a base which is sacred and revered for a global school. In line with this, God, the Exalted founded this global place through his prophets. He wanted this place to become increasingly sacred. The Quran implies the sanctity of this House by pointing out the story of Prophet Ibrahim's seeking residence for his offspring: "O our Lord! I have made some of my offspring to dwell in a valley without cultivation, by Thy Sacred House." [10]
The Commander of the Faithful, Ali (a.) refers to the reverence of the Ka'bah in his "al-Khutbah al-Qasi`ah" (Sermon of Disparagement) where he says: "Do you not see that Allah, the Glorified, has tried all the people among those who came before, beginning with Adam, upto the last ones in this world with stones which yield neither benefit nor harm, which neither see nor hear. He made those stones into His sacred house which He made a standby for the people." [11]
3. Providing a Place of Safety
According to the Quran, Ka'bah is a place of safety and congregation for people. [12] Over the history, no matter how much the enemies of Islam have tried to destroy this place and belittle it, God has aborted their attempts. The story of the Companions of the Elephant (Ashab al-Fil) and the destruction of Abraha and the fleeing elephants are signs of the Will of God, the Almighty.
4. Holding Hajj Rituals
The Holy Quran refers to the splendid and glorious ceremony of Hajj rituals which have a lot of educational, economic, moral and political benefits. It explicitly uses the term "benefit" in regards to the Hajj rituals: "That they may witness the benefits (provided) for them, and celebrate the name of Allah, through the Days appointed…" [13]
5. Benefits and other purposes which we shall suffice to outlining them as below:
A) Creating a business and economic hub for Muslims;
B) An appropriate place for cultural development and exchange of views;
C) Creating and establishing the most important base for combat against polytheism;
D) Creating an appropriate place for intimidating the enemies of Islam and disavowal from the arrogant;
E) Establishing an appropriate place for solidarity and leadership of the Muslim Ummah.

Refrence:

[1] Aal-e Imran:96
[2] Baqarah: 125
[3] Ibrahim: 37
[4] Tabatabai, Sayyed Muhammad Hussein, Al-Mizan, vol.1, p.298.
[5] Ibid, vol.3, p.354.
[6] Ibid, vol.6, p.142.
[7] Aal-e Imran: 96
[8] Wasail al-Shia, vol.11, p.14
ان الله خلق الخلق ... و امرهم بما يکون من امر الطاعة في الدين و صلحتهم امر دنياهم فجعل فيه الاجتماع من الشرق و الغرب
[9] Ibid, p.15
[10] Ibrahim: 37
[11] Nahjul Balaghah, sermon 183.
[12] Baqarah: 125
[13] Hajj: 28
------------------------------
Ref: www.Islamquest.net