If you think companies and organizations do not ask about these directly or indirectly, you need to get out more on the Internet and read the news stories. Queries on social media, for example, has led several states to prohibit such questions. A while back there was a report of a city in Montana requiring disclosure of all social media. These type of questions are invasive and, yes, it does take laws to put a stop to such nonsense.
I never said they didn't. I just wondered why anyone would work for a company that asked such intrusive questions without a good reason.
Personally, a potential employer could ask me anything they want. I'd either give a straight answer or I'd get up and walk out of the room. Either way, I don't have a problem with an employer asking questions like this.