Answering the mentioned question we can point to the following reasons:
First, our Infallible Imams used to do the same: In some Islamic reliable sources it has been indicated that supplicating for Imam Mahdi refers to the manners of the Infallible Imams who used to allocate the best times of their life, e.g. in their prayer, to pray for Imam Mahdi’s health, and they have taught us to do the same. For example: Imam al-Ridā (The Shiite eighth Imam) recommended us to pray continuously for Imam Mahdi by this supplication:
“O Allah distance the whole difficulties from Your successor (on the earth) and protect him from the evil of all of Your creation and preserve him from his right, left, from above and beneath (his feet) with Your protection that if You protect someone he would not face destruction.” [1]
In this regard, Sayyed bin Tāwūs (after pointing to the rewards of praying for one’s religious brothers) states, “Whenever praying for our brothers has this great reward, so praying for a leader who is the cause of our creation must be more important and its reward would be more valuable; a leader who be believe that if he was not created, Allah would not create us as well. Therefore, praying for our Imam should be done before praying for ourselves, our family, and our brothers.”
Second, Imam Mahdi possesses a human body like others: Based on our belief, Imam Mahdi has been born for centuries and he will remain alive till his appearance, but it is so clear that Imam Mahdi is a human and possesses a human body and it makes it highly probable that he would be inflicted with diseases or sustain some sorts of damages in his body. In accordance with some proofs and narrations, it is said that even the prophets and Infallible Imams had some illnesses since they possessed a human body like other people. This is what we read in the Quran that Allah addresses his prophet saying,
“(O the Prophet!), Say: I am just a human being like you (with this difference that) I receive revelation (from Allah).” [2]