Firstly, we have no reliable evidence to prove that Abu Bakr led the prayers after the incident of Ghadir Khum and during the Holy Prophet's illness.
Secondly, the qualities and specifications which qualify a person for Imamate (leadership) are: knowledge, infallibility or inerrancy and immunity to sins in knowledge and action. Therefore, prayer leadership is not a necessary and fundamental condition of Imamate. It will not create any problem as it is not considered to be a deficiency to affect the Imamate. Additionally, there are concrete proofs in the history indicating that Imam Ali (a.s.) led congregational prayers more than anyone else did.
Before dealing with the answer to the question, it is necessary to make mention of the following points:
· The Concept of Imamate:
Imamate, lexically speaking means leadership and whoever becomes the leader of a group, is known as the Imam, whether he leads his group towards the truth or towards falsehood.
However, in the terminology of theology, the Imam means the universal administrator of an Islamic state or society, who administers all the matters relating to this world and the next. That is to say, Imamate is like prophethood and an infallible Imam has all the specifications that the Noble Prophet (pbuh) has except the station of prophethood and messengership. Therefore, his words will be considered as an authority in the field of law and order, and his commands on various governmental matters will be considered obligatory.
· Qualities and Specifications of Imamate:
According to Shia, the main conditions necessary for Imamate are: extensive knowledge, infallibility (immunity to errors and sins). Hence, identifying such an individual is possible through revelation only.
· Imamate and the Wilayah of the Commander of Faithful, Ali (a.s):
There are many Quranic verses and also traditions which prove the Imamate and Wilayah of Ali bin Abi Talib (a.s.). For the sake of brevity, we shall mention here only a few of them:
1. The Quran says:
"انما ولیکم الله و رسوله و الذین آمنوا الذین یقیمون الصلوة و یؤتون الزکؤة و هم راکعون"
[Your guardian can be only Allah; and His messenger and those who believe, who establish worship and pay the poordue while bowing down (in prayer).]
In view of the fact that there are many a number of traditions narrated by Shiite and Sunni scholars, this verse has been sent down about the Commander of the Faithful, Ali (a.s.). The verse clearly denotes the guardianship of Imam Ali (a.s.) especially that the word "wali" in the verse cannot be interpreted as friend or helper because friendship and help relate to all Muslims not only those who pay the poordue while bowing down (in prayer).
2. The verse 33 of Sura Al-Ahzab clearly refers to the infallibility of Ali bin Abi Talib (a.s) and his eleven descendants – peace be upon them. In this verse, God, the Exalted says, "Allah only desires to keep away the uncleanness from you, O people of the House! and to purify you a (thorough) purifying." Many traditions have been transmitted through Shiite and Sunni narrators confirming that this particular verse was revealed in honor of the Holy Prophet (pbuh) and his household. Every wise individual knows that the most fundamental social matter which is the government should be in the hand of the noblest of people. Therefore, the intellect ('aql) does not allow others to take the government in the existence of an infallible in the society.
3. Following the revelation of the verse "and warn your close relatives", the Holy Prophet (pbuh) said in honor of Ali bin Abi Talib (a.s): "This is my brother, my executor and my successor amongst you; listen to him and obey him".
4. Addressing a group of his companions on another occasion, the Prophet (pbuh) said about Ali (a.s.) as such: "Verily, Ali is from me and I am from him, and he is the guardian of every believer after me." 
5. Salman, Abuzar and Meghdad (may Allah be pleased with them) quote the Prophet (pbuh) as having said: "Ali is with truth and truth is with Ali (a.s.)."
6. The Messenger of Allah said to the Commander of the Faithful, Ali (a.s): "The truth is with you, on your tongue, in your heart and between your eyes, and faith has been mixed with your blood and flesh as it has been mixed with my blood and flesh."
7. Ibn-e Abbas says that he heard the Prophet (pbuh) say, "I, Ali, Hasan and Husein and nine of his descendants are pure and infallible."
Keeping in view the above verses and traditions, Ali (a.s.) bears the qualities and conditions for Imamate, and his right to the caliphate after the Prophet (pbuh) is proved.
As for your questions as to why Imam Ali (a.s.) did not lead congregational prayers during the illness of the Prophet (pbuh), we say in response: Firstly, we have no reason to argue that being a prayer leader in the time of the Holy Prophet (pbuh) is one of the conditions for Imamate.
Secondly, there are concrete proofs in the history indicating that Imam Ali (a.s.) led congregational prayers more than anyone else did. For example, when the Prophet (pbuh) went out of Medina on account of the Battle of Tabuk, he appointed Ali bin Abi Talib (a.s.) in his place to lead the congregational prayers and also handle other matters in his absence. It was on this occasion that the Prophet said to Ali (a.s.): "You are to me like Harun to Moses except that there is no prophet after me."
Thirdly, leading congregational prayers does not confer any merit upon the leader because other people like Sa'd bin 'Ebadah, Zaid bin Haretha, Uthman and others have also led prayers in place of the Holy Prophet (pbuh). Without doubt, no one has considered any special merit for it in the sense that it may become an endorsement of someone's candidacy for succession to the Prophet (pbuh).
Thus, we conclude that minor imamate has no relationship with the major imamate and it does not become an "endorsement" or a proof of anyone's candidacy for succession and caliphate.
In addition, we have no reliable evidence to prove that Abu Bakr led the prayers after the incident of Ghadir Khum and during the Holy Prophet's illness and at his order. In fact, the story of Abu Bakr going to the mosque to lead prayers during the Holy Prophet's illness was Aisha's plan. When the Prophet (pbuh) learned about it, he despite being ill went to the mosque, pulled Abu Bakr aside and led the prayers himelf.
 - Mesbah Yazdi, Muhammad Taqi, Theological Instructions, pg.273.
 - Ibid.
 - Al-Maedah: 55
 - Tasir Noor al-Thaqalain, vol.1, pg.643; Minhaaj al-Bara'ah, vol.2, pg.350; For further information, see: Ehqaqul Haq, vol.2, and "Al-Ghadir", vol.2, and "Al-Muraja'at". Tafsir Nomouneh, vol.4, pg.426.
 - "انما یرید الله لیذهب عنکم الرجس اهل البیت و یطهرکم تطهیراً"
 - Sahih Muslim, Kitab Fazael al-Sahabah, chapter 9, Majma' al-Zawaed, Heithami, vol.9, pg.203.
 - Tahzibul Istibsar, Ibn Jarir Tabari, vol.3, pg.62.
"ذا اخی و وصیی و خلیفتی فیکم فاسمعوا له و اطیعوا"
 - Sunan al-Tirmidhi, vol.5, pg.632; Sunan al-Nesae, vol.5, pg.132.
ان علیا منی و انا منه، و هو ولی کل مؤمن بعدی"
 - Behar al-Anwar, vol.38, pg.30. (ان علیا منی و انا منه، و هو ولی کل مؤمن بعدی)
 - Al-Ghadir, vol.3, pg.179.
(إن الحق معک والحق علی لسانک و فی قلبک و بین عینیک والایمان مخالط لحمک و دمک کما خالط لحمی و دمی).
 - Yanabi'ul Mawaddah, pg.534;
(عن ابن عباس قالب سمعت رسول الله (ص) یقول: انا و علی و الحسن و الحسین و تسعة من ولد الحسین مطهرون معصومون).
 - Without doubt, the two Quranic verses require a great deal of explanation which should be read in its appropriate place and this article lacks it.
 - Behar al-Anwar, vol.22, pg.249.
 - Al-Seerah al-Nabaviyah, Ibn Hesham, vol.4, pp.519 and 520
"انت منی بمنزلة هارون من موسی الا انه لا نبی بعدی"
 - Ibid. The Arabic version of the narration that lists the names of people who offered prayers in place the Holy Prophet is as under:
و من قدمهم للصلاة فأمیر المؤمنین کان یصلی بالمدینة أیام تبوک و فی غزوة الطائف و فدک و سعد بن عبادة على المدینة فی الأبواء و ودان و سعد بن معاذ فی بواط و زید بن حارثة فی صفوان و بنی المصطلق إلى تمام سبع مرات و أبا سلمة المخزومی فی ذی العشیرة و أبا لبابة فی بدر القتال و بنی قینقاع و السویق و عثمان فی بنی غطفان و ذی أمر و ذات الرقاع و ابن أم مکتوم فی قرقرة الکدر و بنی سلیم و أحد و حمراء الأسد و بنی النضیر و الخندق و بنی قریظة و بنی لحیان و ذی قرد و حجة الوداع و الأکیدر و سباع بن عرفطة فی الحدیبیة و دومة الجندل و أبا ذر فی حنین و عمرة القضاء و ابن رواحة فی بدر الموعد و محمد بن مسلمة ثلاث مرات و قد قدم عبد الرحمن بن عوف و معاذ بن جبل و أبا عبیدة و عائشة بن محصن و مرثد الغنوی. عماله ولى عمرو بن حزم الأنصاری نجران و زیاد بن أسید حضرموت و خالد بن سعید العاص صنعاء و أبا أمیة المخزومی کندة و الصدق و أبا موسى الأشعری زبید و زمعة عدن و الساحل و معاذ.
 - Rasul Ja'fariyan, Seera of the Messenger of God (pbuh), pg.676; Ibn Abil Hadid, Sharh Nahjul Balaghah, vol.9, pg.197.