It is permissible to pay zakah to a Muslim leader, whether he is just or not, provided he rules (more or less) according to Islamic laws. The property owner absolves himself of his obligation by giving zakah to the leader. If the leader does not distribute it properly, it is preferable that the property owner do so himself, unless the leader or his agent asks for it.
Anas reported: “A man from the tribe of Banu Tamim came to the Messenger of Allah, upon whom be peace, and said: ‘O Messenger of Allah! If I paid the zakah to your representative, am I acquitted of my responsibility?’ The Messenger of Allah, upon whom be peace, said: ‘Yes, if you pay it to my representative, then you have acquitted yourself. Its reward will be yours and its sin will be upon whoever misused it.'” This is related by Ahmad.
Ibn Mas’ud reported that the Prophet, upon whom be peace, said: “After me, there will be selfishness and you will deny obligations.” They said: “O Messenger of Allah! What do you command us to do?” He answered: “Pay the due which is upon you and ask Allah what is right for you.” This is related by al-Bukhari and Muslim.
Wa’il ibn Hajar reported: “I heard the Messenger of Allah, upon whom be peace, say after a man had asked him his opinion of our leaders who deny their right [of collecting and distributing the zakah]: ‘Listen and obey, for indeed, they have their responsibility and you have yours.'” This is related by Muslim.
Commenting on the subject, ash-Shaukkani says that the hadith cited in this section are used by many scholars to justify the permissibility of transferring both kinds of zakah to unjust rulers. This applies to rulers of Muslims in the world of Islam (Dar al Islam).
As to contemporary Muslim governments, Sheikh Rashid Rida says: “At present, the majority of Muslims do not have an Islamic government which establishes Islam, propagates and defends it, calls for jihad individually or collectively, implements its divine injunctions, and collects and distributes zakah according to the rules laid down by Allah, the Exalted One.
Some of the Muslim rulers are under the influence of Western powers, while others are under the tutelage of polytheists. These foreign powers employ Muslim leaders as tools to subjugate the people in the name of Islam, thus destroying Islam itself. They use the influence of the Muslim leaders and Muslim resources, including zakah and endowments, to further their interests. To such rulers, it is not permissible to pay any part of zakah, regardless of their title or profession of faith. As for the rest of the Islamic governments whose rulers and heads of state profess Islam and whose finances are not controlled by foreigners, the payment of unhidden zakah should be made to their leaders. This also applies to hidden properties, such as gold and silver, when the leaders request it, even if they are unjust in some of their judgments, as is said by the jurists.”