Just because nobody has sued does make it a legal inquiry.
Difficult to win a case because you would have to prove that you didn't get the job because you either refused to answer the question or you answered that you were. And I would bet that few outright ask if you are gay as opposed to inferring the question and letting a player get the hint and answer the question withou ever being asked. For example, I doubt I ever leave an interview without knowing if a person is married or know the number of kids they have etc etc etc even those asking about any of that isn't legal.
The fact that you even remotely think it isn't clearly demonstrates you don't have a clue what you are talking about.