It’s known that one whose Prayer is valid can lead others in Prayer and vice versa. Yet, the Imam should be well-qualified to lead people in this outstanding pillar of Islam, namely Prayer.
Sheikh `Atiyyah Saqr, former head of Al-Azhar Fatwa Committee, states: “Al-Bukhari reported that Ibn `Umar used to pray behind Al-Hajjaj as an Imam. Muslim also reported that Marawan led Abu Sa`id Al-Khudri in `Eid Prayer, and he performed some acts of bid`ah (innovation in religion) regarding the political system. Ibn Abi Mu`ayt led Ibn Mas`ud in Prayer and he was a drunkard. Ibn Abi Mu`ayt once prayed four rak`ahs (Prayer units) while leading the morning Prayer and was whipped by `Uthman Ibn `Affan as a punishment for that.
Scholars hold the opinion that one whose Prayer is valid can lead people in Prayer. Also, they are of the opinion that it is blameworthy to be led in Prayer by an innovator (someone who performs bid`ah). Sa’ib Ibn Khallad reported that a man once led the people in Prayer and spat in the direction of the qiblah while the Prophet (peace and blessings be upon him) was looking at him. The Prophet (peace and blessings be upon him) said: “He must not lead you in Prayer.” So the people prevented him from leading Prayers after that, and when they informed the Prophet (peace and blessings be upon him), he said: “Yes, he has done wrong with regard to Allah and His Prophet.”