Controversial subject.
In my opinion most of the time it is gratuitous T&A, the producers encouraging the audience to hope for a look at a major star in the buff.
In some films it is essential to the plot. The first feature on which I did sound design (Johnny Montana) had a lot of full frontal sex scenes, but it was a gritty portrayal of a mans degeneration into the world of paid sex partners. The film earned the Soundpost Award, Best Production Award, Best Feature Award at the 2006 Moondance International Film Festival and the Silver Spotlight Award for Best Debut Feature at the 2006 Australian International Film Festival.
I could go on with a list of other films that had gratuitous sex scenes, and others where it was needed to advance the story, but 90% of the time it is not really needed.