I was planning to write about this myself some time, but Mary Harrsch has done such a great job that you should read her excellent summary on whether sacred sex was practiced in ancient times.
Sacred sex is the idea that some temples - invariably dedicated to Aphrodite or the local equivalent - had in-house prostitutes whose service was considered part of the worship. Whether it ever actually happened is very controversial.
I have no choice but to form a definite opinion because I must describe these temples in my books! Particularly the Artemision at Ephesus which appears in the second book, and for which there's a claim of temple prostitution. (And my view is there wasn't.)
Most mention of this subject comes with the sound of ideological axes grinding in the background. Which makes Mary's article so valuable, because it's actually even handed.