basing a hiring decision on something that you are not allowed to base a hiring decision on is. I think it would be possible to ask any old question you want, then back it up with enough documentation of why, outside a particular answer to the question "Are you gay?", you did not hire someone. Not asking the question is just a shortcut.