It is a terrible ordeal, but for all of the other factors brought up the critical factor is that he set off an explosion detector (and clearly it doesn't get false positives often given the response they showed). Everything else (about Ramadan, being Hindi, the color of one's skin, etc) may be nothing more than decorations, and no one here knows what would happen if John Smith Anglosaxon set off the same detector in…
I've always wondered what happens if you set off the detector. The fact is that they allowed him to fly afterwards. Overall it's not so horrible. Assuming the thing about the photo isn't true, of course.
If you detained and questioned an innocent man and ruined his day costing him a weeks wages for some, wouldn't you do SOMETHING to make up for it?
A decent person would, a bureaucratic organization that is not held accountable sure wont.