The Messenger of Allah (sal Allahu alaihi wa sallam) said: “No Prophet has ever died until a man of his Ummah led him in prayer.” [Al-Bazzar]
The person who led the Prophet (sal Allahu alaihi wa sallam) in prayer in his final illness was none other than Abu Bakr (radi Allahu anhu), his life-long and dearest friend.
The Prophet (sal Allahu alaihi wa sallam) asked for him to lead the Muslims in prayer in Masjid-e-Nabawi when he was too weak and ill to perform this obligation himself.
The political leader of the Muslims is the one whose job it is to lead the people in congregational prayer as well. This indicates that the political leader of the Muslims must be a pious Muslim who satisfies the conditions required to be an Imam of prayer.
The Prophet’s asking Abu Bakr (radi Allahu anhu) to take his place as the Imam of the Muslims is an indication that Abu Bakr (radi Allahu anhu) was the best person to lead the Sahabah and the Muslim Ummah. It is him whom Allah (subhana wa ta’ala) desired should lead the Muslims after the demise of the Prophet (sal Allahu alaihi wa sallam).