Sex is one of the big human motivations along with love, money and power. It's an important part of human life and that's why people have been writing about it since we started writing fiction. We may feel more relaxed about the level of explicitness nowadays, but writing about sex has always been around.
I write about relationships, generally about people getting together or breaking up. Sex plays an important part in relationships, so I include sex scenes in my books. It's important for my characters and where they are in the story. If I were writing about bank robberies or space travel where the main character motivators were things like money, power and discovery, I would probably write no sex scenes at all.
Sex is part of being human, so we should write about it - if appropriate to that particular story. But if it isn't appropriate then it shouldn't be there. Take Sebastian Faulks's Birdsong. There are some fairly explicit sex scenes in that, and I've heard people say that they are inappropriate. But the scenes of WWI are equally explicit in their depiction of the horrors of war, so to me the sex scenes and battle scenes balance each other.
It's part of your judgement as a writer whether a sex scene is appropriate in your writing. And if not, that's fine. It really isn't compulsory.