Without doubt every divine ruling has its philosophy and reason(s), but we do not have to investigate every ruling and find its philosophy. A true Muslim must surrender before the message of revelation. This character of submission and acceptance creates perfection in the human being and essentially some rulings are obliged upon mankind to test and gage his level of obedience and faith.
However, the Quran itself has mentioned rulings along with their reasons. The infallible imams have also disclosed these philosophies and Muslim scholars have dedicated their time and effort in writing books regarding the secrets of Islamic shariah, e.g., prayer and some of its pillars (arkan) and details; such as the secrets of niyyah (intention), tashahud, ruku', Sajdah, the salams….
Without doubt every divine ruling has its philosophy and reason, but we do not have to investigate every ruling and find its philosophy. A true Muslim must surrender before the message of revelation. This character of submission and acceptance creates perfection in the human being and essentially some rulings are obliged upon mankind to test and gage his level of obedience and faith. God’s command to Ibrahim (A.S.), to sacrifice his child Ismail, is a fine paradigm.
What you will realize in this brief response is that every Islamic ruling and worshipping code in Islam has its philosophy.
Firstly: because of hundreds of Quranic verses and hadith which encourage people to think and ponder.
Secondly: one of the strongest criticisms of the Quran against mushriks and idol worshipers is that they blindly and unreasonably follow their ancestors.
Thirdly: the Quran itself has mentioned rulings along with their philosophy.
The infallible imams have attended to disclosing these secrets in the traditions received from them and Muslim scholars have written books on these secrets and philosophies.
In light of these points one must add:
1. It isn't indispensible that all people in all times know of all of these philosophies.
2. We must be aware not to solely perceive the philosophy of Islamic rulings as material and worldly benefits and simply focus on the financial, sanitarian, etc., facets and neglect the spiritual and moral effects.
3. One who believes that God is wise and obliges his rulings upon mankind accordingly, should not look for reasons and explanations and rely on the wisdom of his lord. However, reasons and philosophies have been mentioned regarding prayer, some of its essentials (arkan), details and recitations such as intention (niyyat), tashahud, ruku’, sujud, salam, etc. Here, we will point out a few examples.
Prayer Prohibits Evil
The Quran says: Prayer prohibits from evil and vice.
Prayer and Effacing Negligence
In another section we read: Keep up prayer for My remembrance.
Prayer and Tranquility
It also reads: By Allah’s remembrance are the hearts set at rest.
Battle Against Pride and Arrogance
Prayer, which is the remembrance of the source of every greatness and appeal to the center of power and greatness, eliminates self pride and arrogance. In other words, prayer shatters pride and arrogance; because one who prays seventeen raka’ts of prayer in a 24 hour time span and places his forehead on the ground in humbleness in every raka’t, perceives himself as a tiny creature before his lord and tears open apart the veil of being self-conceit. This is why, after faith, Imam Ali (A.S.) describes the first and most important worship with this same goal, to be prayer: Allah has obliged faith to cleanse man from uncertainty and prayer for cleansing him from arrogance.
Developing the Habit of Punctuality and Organization
Prayer develops the habit of punctuality; because this ritual must be done in certain times and performing it earlier or postponing it will invalidate it. The same goes for other parts of the prayer such as, intention, qiyam, ruku’, sujud, qu’ud. etc., which facilitate the tendency to be punctual and organized in other aspects of life.
Remembrance of Resurrection
One who prays remembers the hereafter and its greatness when reciting “Master of the Day of Judgment”. It reminds him that there is a world other than this one which is the result and manifestation of our actions and deeds in this world.
Expressing love to the good and disassociation and aloofness from evil is one of the philosophies of reciting the verses of the holy surah of Al-Hamd. One who prays and recites “ایاک نعبد و ایاک نستعین، اهدنا الصراط المستقیم صراط الذین انعمت علیهم”, is seeking the friendship and closeness of God Almighty, the Prophets, the right doers, martyrs and the righteous and moves to their side and by saying “غیر المغضوب علیهم و لاالضالین”, distances himself from the mislead and deviated.
In the end we must point out that: the reason for the obligation of prayer is the remembrance of and admitting to Allah being our lord, battling with shirk and idol worshipping, standing before Allah in humbleness, admitting to our sins and asking for forgiveness and placing the forehead before Allah and His glory. Some of the other main reasons for praying are to be constantly aware, not allow negligence to takeover, become proud of oneself and self-conceit, humbleness and for our blessings to blossom.
These were some of the Quranic verses and ahadith which unveil some of the secrets and philosophies of prayer.
Before concluding it is necessary point out that numerous books and articles have been written about the secrets and philosophies of prayer by different authors and Shiite scholars.
Sources for further research:
Ilal al-Sharaye’, Sheikh Saduq
Sirr al-Salah and Ādāb al-Salah, Imam Khomeini
A Glimpse at the Philosophy of Prayer, Mohsen Qara’ati
The meaning and effects of prayer, 2997 (website: 3242).
The philosophy behind the five times of prayer, 3837 (website: 4101).
The philosophy behind the tashahud and salam, 13141 (website: 12808).
The spiritual and material effects and blessings of prayer, 9593 (website: 10797).
 Nahl:44; Aal Imran:191.
 Ankabut:45; Baqarah:183.
 Nahjul-Balaghah, saying 252. “وَ قَالَ (ع) فَرَضَ اللَّهُ الْإِیمَانَ تَطْهِیراً مِنَ الشِّرْکِ وَ الصَّلَاةَ تَنْزِیهاً عَنِ الْکِبْر”.
 Sheikh Saduq, Man la Yahduruhu al-Faqih, vol. 1, pg. 214, Jame’eye Mudarresin, Qum, second edition, 1404 AH; Sheikh Saduq, Ilal al-Sharaye’, vol. 2, pg. 317, Davari, Qum, first edition, “إنّ علة الصلاة أنها إقرار بالرّبوبیة للّه عزّ و جلّ، و خلع الأنداد و قیام بین یدی الجبّار جلّ جلاله بالذّلة و المسکنة و الخضوع و الاعتراف، و الطّلب للإقالة من سالف الذّنوب، و وضع الوجه على الأرض کلّ یوم إعظاما للّه جلّ جلاله و أن یکون ذاکرا غیر ناس و لا بطر.و یکون خاشعا متذلّلا راغبا طالبا للزیادة فی الدّین و الدنیا مع ما فیه من الإیجاب، و المداومة على ذکر اللّه عزّ و جل باللّیل و النهار و لئلّا ینسى العبد سیّده و مدبّره و خالقه، فیبطر و یطغى و یکون ذلک فی ذکره لربّه عزّ و جلّ، و قیامه بین یدی”.