As veinglory says, there was and is plenty of sex in fantasy. Maybe less in the last 5-10 years, but certainly before that and in many of the touchstones of the genre.
Is there less sex than there used to be? I'm trying to think about novels I've read that were published recently. Hmmm.
Novik's
Untangled has a sex scene. Carey's stuff does, obviously. Some of Jemisin's does. Abercrombie's YA trilogy does. CS Pacat's does.
I can think of a number of newer books and authors that have no sex, or just fade to black or summarized sex, in their books too. I have no idea how the percentage stacks up. With most of these, it's either because there's no actual focus on any romantic arc in the story (or no opportunity to consummate it if there is), or because the story is told in the kind of voice where a vivid sex scene would feel out of place. For example, Kowal's books are inspired by Jane Austin, so mentioning sex would feel out of place.
If sex is less common in fantasy lately, is it because there are more stories where sex would actually not be relevant (perhaps stories that focus on other kinds of relationships than romantic ones), or is it because publishers are less likely to accept books with sex in them, or require that such scenes be edited out or down these days?
The only fantasy books I've read recently that I can think of where the omission of sex scenes feels a bit "off," as if they
should have been included but were cut out, was in the first couple of McCullough's books (haven't read the rest yet). Not sure when that series started though.
I can't tell how these examples compare to the overall percentage over the past several decades. It's true that sex took place in fantasy and SF novels well before the 80s. Writers like McCaffrey, McIntyre and others come to mind. I'm always surprised when people ask if it's "allowed" in SFF.
Though the OP wasn't asking that, exactly, but how much turns a novel into erotica. My answer is that erotica isn't so much about the amount of sex, or even its explicitness, as it is about the
role the sex plays in the plot and in
how it's presented. Is a reader going to be looking specifically for well-written sex scenes when they pick up the book, or will they find them relevant but not a main point of the story? Of course, some readers categorically hate sex scenes, and maybe even think they're a deal breaker, no matter how well written and no matter what their role is. If sex is important in a story, it's not aimed at that readership.