Please read the narration.
We know that Abu dhar died in the time of third Caliph Uthman. Abu Dhar (rz) used to make objections on the actions of third Caliph Uthman. Abu Dhar was expelled him from Medina out in the deseret. There in deseret (RABZA) Abu Dhar (a rightous companion) of Holy Prophet died in miserable condition.
As we know that Abu Dhar had seen the rulers (caliphs) in his life are Abu Baker, Umar bin Khattab, Uthman and Moawiya bin Abu Sufyan.
We also find in this narration that the Holy Prophet advised Abu Dhar to pray obligatory prayer alone on its time, when the other people pray later, you join with them for (the unity), that prayer will counted as your Nafal prayer.
From such narrations, we can also understand the action of Imam Ali ibn e Abu Talib, if Imam Ali joined with the other companions, that was for the sake of unity, to save Islam and Muslim Ummah from the sever consequences.