illegal (?) ban

I lived and worked for 3 years in Qatar. Leaving last month, I was denied the NOC to return and seek new job opportunities in Doha (which was partially expected!). What came as a surprise though was my ban to EVEN visit the country.
1. I resigned for the company (Qatar Airways), I was not terminated
2. I had a clean record, no warnings or so, in 3 years of employment
Up to which point a company has the right to blacklist someone? Are they abusing their power?
Shouldn't it be the Immigration dep or something relevant, that makes this decision? and for certain reasons?
How can I check if this ban is valid/legal?
I am already back to my country, in Europe, and just found out when I mailed my ex-employer to make sure I wouldn't have to reach the airport and fly back! this is the reply I received (which feels so sarcastic!):
"Dear El.,
Greetings from Doha!
Hope this email finds you well.
We would like to acknowledge the receipt of your email.
Please be informed that as stated in your personal file, your request to re-enter and visit Doha was not approved at the time of your resignation.(you were informed on 13 July 2014)
Therefore we would not be able to forward the same request again , as the HR and management decision is considered Final.
We do apologized that we could not be of assistance on this occasion.
Your understanding and co-operation will be much appreciated.
Take care and wishing you all the best!
Best Regards,
Kittima Prapas
Cabin Crew Welfare Officer"
You must have been in their bad and naugthy list. QA keeps full file on all their staff, they keep every details of Bads and Goods. If you had more Goods on your file, they will help you and treat you nice, but if you were on their Bad side, all hell will drop on your file and future opportunities in Qatar. For them, to even ban you, you must reflect and look back what you have done to piss them off.