Working in the tax office and taking money for that

I was working in a tax department for nine years, thinking that it is undoubtedly Halal work. Then I was told by some brothers that my work is haram, so I asked one of the students of Islamic knowledge here and he said that if I work with an intention to ease it for people, then its permissible work and I will even be rewarded. After this I continued working for little while but I did not feel comfortable so I decided to resign. Now after leaving this job the state owes me some financial rights, money was discounted for the social insurance and other funds, is it permissible for me to take it and use it? And what is the ruling on the previous salaries I got before I knew it is a haram job? Is it permissible for me to return to this work and try my best to help the people?.

Praise be to Allaah.

Firstly: 

Working for the tax department is haraam, because it is participating in taking people’s wealth unlawfully, unless the one who works in that intends to reduce the people’s burden, and relieve them of wrongdoing as much as he is able to, in which case there is nothing wrong with him doing this job and indeed he will be a doer of good. 

This has been discussed in the answer to question no. 39461

Based on this, there is nothing wrong with you going back to this job with the aim of reducing the burden for people, and we ask Allaah to help you to do all that is good. 

Secondly: 

With regard to the salary that you received before you learned that it is haraam, there is nothing wrong with it in sha Allaah. Allaah says concerning riba which is one of the gravest of major sins (interpretation of the meaning):  

“So whosoever receives an admonition from his Lord and stops consuming Riba, shall not be punished for the past; his case is for Allaah (to judge)”

[al-Baqarah 2:275] 

Allaah allowed them to keep what they had taken of riba before they came to know that it is haraam. 

Similarly, we do not think that there is anything wrong with the financial rights that the state owes you for the period when you worked for them. 

And Allaah knows best.

Islam Q&A