Having some unlawful elements among the income of government does not affect the salaries of officers. What is significant is the legitimacy of the effective job the officer is doing. If the job that the officer is doing is lawful (halal) according to Islam, then his salary is also lawful (halal). Besides, major portion of government incomes is obtained from lawful elements.
Money itself is not halal or haraam. The method to earn money makes it either halal or haraam. This is called “haraam li-ghairihi”. Such things are not haraam in essence, but haraam due to the way they are obtained through. Therefore, money that is haraam for one person can be halal for another person; so is the money earned by a government officer.
There are also other unlawful things, which are haraam in essence such as, fornication, stealing, eating pork, having intoxicants, etc. This is called “haraam li-dhatihi “. They are unlawful for all Muslims at all times. For instance, a Muslim is not allowed to serve pork, as well as being not allowed to eat it.