They have been doing this since the beginning of Policing in America. It’s a question to see how you would react under stress. The best answer is, “That is none of your business, thank you.”
And you move on. A wuss who gets bent out of shape for that question has no business being an officer.
No, detailed sexual questions to today’s degree have not been part of the history of American policing.
And this is not in an interview, it is in the polygraph process.
Refuse to answer there and the polygrapher will report you as non-cooperative (deceptive) and you are out of the process.
No one should have to discuss their sexual activities in detail for employment. Especially when it involves their wife or husband. if it isn’t cause for firing, it isn’t relevant.