The third person mentioned in the ḥadith of Abu Hurayra is a man who gives his pledge of allegiance (bayʿah) to an imam only for worldly gain: if the ruler grants him something, he honors the pledge; if he withholds it, he breaks it. This man, too, is among those whom Allah will not speak to on the Day of Resurrection, nor look at, nor purify, and for whom there is a painful punishment.
The reason is that pledging allegiance to the imam is an obligation: every Muslim must have an imam. That imam may be a universal leader, as was the case in the era of the Rightly Guided Caliphs and the caliphs who succeeded them, or a regional imam, as has been the situation for many centuries—since the time of the four great jurists and those who followed them—when Muslims became geographically dispersed. Each area has its own imam, and by the consensus of the Muslims every such imam is to be heard and obeyed. No Muslim scholar has ever asserted that obedience is required only if a single caliph governs all the lands of Islam; no one could realistically claim that, for if it were a condition, Muslims today would have neither imam nor amir, and everyone would die a death of ignorance. Whoever dies without an imam dies such a death and will be resurrected with the ignorant people who lived before the coming of the messengers—Allah’s protection is sought. Accordingly, leadership exists, and in every region it rests with its respective imam.