After all...
After all, Abu Bakr himself, Umar bin al-Khattab, and Abu Obaida ibn al-Jarrah, all three had served under Amr bin Aas in the campaign of Dhat es-Salasil, and had offered their prayers behind him for many weeks. Amr bin Aas had made it plain to all three of them that he was their boss not only in the army but also as a leader in religious services.
As already noted, the Sunni Muslims assert that the Prophet chose Abu Bakr to lead the public prayers just before his death because he wanted the latter to be his khalifa. Ibn Hajar Makki, a Sunni historian, says in his book, Tatheer al-Janan (page 40): “Abu Bakr led Muslims in prayer (at the orders of the Apostle).
It is, therefore, the consensus of all scholars that his khilafat was by the fiat of the Apostle.” But the same Sunnis also hold the view that leading other Muslims in prayer does not confer any merit upon the leader himself, and that it is not necessary for a man to be “qualified” to act as an Imam (prayer-leader).
In this connection, they quote the following “tradition” of the Prophet of Islam on the authority of Abu Hurayra: Abu Hurayra reports that the Apostle of God said that: “Prayer is a mandatory duty for you, and you can offer it behind any Muslim even if he is a fasiq (even if he commits major sins).” According to this “tradition” a fasiq (sinner) is just as well qualified to be an Imam (prayer-leader) as a saint; in the matter of acting as Imam, the sinner and the saint enjoy parity!
John Alden Williams And hearing and obeying the Imams and the Commanders of the believers (is necessary) - whoever received the Caliphate, whether he is pious or profligate, whether the people agreed on him and were pleased with him or whether he attacked them with the sword until he became Caliph and was called “Commander of the Believers.” Going on a holy war (Jihad) is efficacious with a pious or with a dissolute commander until the day of Resurrection; one does not abandon him.
Division of the spoils of war and applying the punishments prescribed by the Law is for the Imams. It is not for anyone to criticize them or contend with them. Handing over the alms-money to them (for distribution) is permissible and efficacious; whoever pays them has fulfilled his obligation whether (the Imam) was pious or dissolute. The collective prayer behind the Imam and those he delegates is valid and complete; both prostrations.
Whoever repeats them is an innovator, abandoning the tradition and opposed to the Sunna.