Shaykh al-Islām—may Allah have mercy on him—was also asked:
About a man entitled to payment from the public treasury, either for his contribution to jihad or for holding public office, who was directed to collect part of his entitlement from certain unjust exactions.
He replied:
Do not collect this yourself or assist in collecting it, for that is wrongdoing. Rather, seek your entitlement from the funds already collected and held by them, even if those funds have been gathered from this and other sources. For money accumulated in the public treasury and not returned to its owners is better spent on the interests of its owners and the Muslims than on purposes that do not benefit its owners or that harm them. I have written about a similar issue elsewhere.
Moreover, the money becomes mixed with other funds, so the ruling prohibiting that particular property no longer applies to it, while spending on someone in this position is an obligation upon the Muslims. Officials sometimes commit injustice in collecting funds and sometimes in spending them. It is therefore unlawful to assist them in unjust collection, or for anyone to take what he is not entitled to.
As for collection and expenditure that admit of legitimate juristic judgment, these are to be treated as matters of juristic judgment. But where taking and giving admit of no such judgment, they must not be assisted.