Was he questioned initially because he didn't eat any thing or was going on religious trip or was brown or anything related to muslims or Ramadan? NO
He should have said don't fly when you touch bug spray/ insecticides and want a pat down. The title should be around the context and its not the case here.
Some years ago I used to regularly fly from London to Boston, see clients, take the Delta shuttle down to New York see more clients, then fly back from there to London.
Every single time I would be chosen for the "random" extra search going through security for the shuttle. And due to the sensitivity of the Boston-New York flight only a few years after 9/11, the extra checks were pretty thorough.
One time, while chatting to the security chap as he was metal-detecting my belt, I asked why I was stopped so often. He told me that it was a combination of my being foreign (British but fair enough) and the fact that I was taking a one way trip. Apparently they had concluded that suicide bombers only buy singles. I did point out that, under the circumstances, they probably wouldn't be overly concerned about the money wasted on the return portion. However, my application of reason didn't prevent me from being searched on all subsequent flights.
As an aside, I never experienced anything like the trauma of the OP. The security people were always very polite and friendly. I'd like to think it's due to the bonhomie of the Bostonians. I suspect though that it's because I don't look archetypically Muslim.
Makes me sad about what happened to the author, but Ramadan has very little (if anything) to do with it.