I can understand the inconvience caused to you, but let me assure you that all over the world its the same. Very few places they issue transit visas and transit visas are with reciprocal countries only. Infact in other countries they could also detain you. I have traveled all over the world and its the same everywhere.
I think the immigration could have been a little more helpful but its entirely your fault that you traveled without the relevant papers especially during times when you know that the security is on high alert.
I am sure you must have not offered any bribe to the concerned officer else you would be allowed. Anyways have a pleasant stay when you get back to India.