Musa bin Tarif al-Asadi said: Sayyiduna Ali (may Allah be pleased with him) entered the public treasury (bayt al-mal) and expressed his contempt for it. He said: "I will not reach the evening while a single dirham remains in you." He ordered a man from Banu Asad, and he distributed it until nightfall. The people said: "If only you had given him some compensation!" He said: "If he wishes, but it is unlawful (suht)."
Imam al-Shafi'i (may Allah have mercy on him) said: It is not lawful for anyone to give unlawful earnings, just as it is not lawful to take them, and Sayyiduna Ali (may Allah be pleased with him) would not give anything unlawful to anyone.
Its chain is weak; Musa bin Tarif is not used as proof.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20441