We know from the Holy Quran that there are two types of Imams (guides), those that guide by the command of Allah (swt), and those that lead us to the fire of hell.
وجعلنا منهم أئمة يهدون بأمرنا لما صبروا وكانوا بآياتنا يوقنون
And when they became steadfast and believed firmly in Our revelations, We appointed from among them leaders who guided by Our command.
وجعلناهم أئمة يهدون إلى النار ويوم القيامة لا ينصرون
And We made them leaders inviting to the Fire, and on the Day of Resurrection they will not be helped.
And our Holy Prophet (pbuh) applied this rule when he told Ammar ibn Yassir:
يا عمار تقتلك الفئة الباغية، تدعوهم إلى الجنة ويدعونك إلى النار
"O Amar you will be killed by the oppressive class, you invite them to heaven and they call you to the fire.’
This reveals that the Imamate under which Ammar lived and fought, was the one on the right path to salvation.
Now, in the case of Fatima (as), the lady of the women of the worlds, who is a piece of Prophet Mohammed (pbuh), at the time of her father, he was the Imam and she had pledged allegiance to the Messenger of Allah (pbuh).
So the question I direct to all Muslims of the world: After the Messenger of Allah (pbuh) passed away, who did Fatima pledged allegiance to? We know that Fatima (as) went to the Lord a martyr and angry at the first Khalifa. There is no doubt that she did not pledge allegiance to the first caliph, Abu Bakr, and neither did her husband, Ali bin Abi Talib (for a period not less than mentioned in Sahih Bukhari, which was six months). What is the conclusion we have to make based on the narrations we’ve mentioned up to now? You (followers of the school of companions and the wahabis) consider the Imamate of Abu Bakr to be legitimate, therefore Fatima (as) died a death of ignorance, and if Imam Ali (as) had died in this period (the six months before Fatima’s martyrdom), he would have died a death of ignorance. And both are free of such accusations, since it is clear for the followers of Ahlul Bayt, that Imam Ali (as) was the rightful Imam of his time and Fatima had pledged allegiance to him.
الرواية واردة في (صحيح البخاري) ص803، الحديث 4240 و4241 عن عائشة أن فاطمة عليها السلام بنت النبي أرسلت إلى أبي بكر تسأله ميراثها من رسول الله مما أفاء الله عليه بالمدينة وفدك وما بقي من خمس خيبر فقال أبو بكر: إن رسول الله (صلى الله عليه وآله) قال: لا نورث ما تركنا صدقة، إنما يأكل آل محمد (صلى الله عليه وآله). فأبى أبو بكر أن يدفع إلى فاطمة منها شيئاً فوجدت يعني فغضبت، فوجدت فاطمة على أبي بكر في ذلك فهجرته فلم تكلمه حتى توفيت، وعاشت بعد النبي ستة أشهر. فلما توفيت دفنها زوجها علي ليلاً ولم يؤذن بها أبا بكر وصلى عليها، وكان لعلي من الناس وجه حياة فاطمة فلما توفيت استنكر علي وجوه الناس فالتمس مصالحة أبي بكر ومبايعته
In this regard, the narration is contained in (Sahih Bukhari), p. 803, #4240 and 4241, narrated Aisha that Fatima (as), daughter of Prophet sent for Abu Bakr to ask for her inheritance from the Messenger of Allah, which Allah has bestowed upon him in Medinah and Fadak and what remains of the war booty from Khyber, so Abu Bakr said: The Messenger of Allah (pbuh) said:’We do not leave inheritance of what we left as charity.’ Abu Bakr refused to pay anything to Fatima and became angry, and did not speak to him until she died; she lived six months after the Prophet passed away. When she died, she was buried by her husband Ali at the night, and Abu Bakr was not authorized to attend; later Ali had to reconcile with Abu Bakr and pledge allegiance to him to satisfy the requests of the people.
So during those six months Imam Ali and Fatimah (as) had not pledged allegiance to the first caliph. And based on the conditions of Imamate that the school of Ahlul Bayt adheres to, the Imam has to be infallible. And it is agreed by all muslim scholars that the first caliph was not infallible. Then you have to accept that Sa’ad ibn Ubadeh, the leader of the Ansar, also died a death of ignorance, because he neither pledged allegiance to the first caliph. You also have to accept that whoever did not pledge allegiance during the caliphate of Imam Ali (as) also died a death of ignorance, the best of example of which is Mu’awiyah. Mu’awiyah didn’t just not accept his Imamate but fought him in the battle of Siffin.