You touch an important point, that there is a safety rather than religious concern in play here.
Presuming everyone has forgotten 9/11, it might be fair to say that the hijacking risk in this country was a free trip to Cuba. That's not a universal experience though.
A number of times a similar question, usually requesting identification of Americans and/or Jews but designed to segregate passengers, has been asked on airplanes and on occasion ships. It's generally asked after control of the particular means of transport has been achieved, and has frequently ended in death.
It sounds as though the nature of this incident was known rather quickly, but a pilot, presumably aware of the history of hijackings, should know better. A resonable person could have concluded something was wrong, in fact it sounds as though a number did. There could have been a bad ending here.