In the media, sex is often portrayed as "cool". If you're not having sex, then you're a sniveling misfit and a loser.
Sex is guaranteed to sell a product, or to bump up the ratings and views on a movie or a television show.
A sure-fire way for a singer or an actor to market themselves is to "sex themselves up" with makeup, styled hair, a fit body (or plastic surgery to make their faces and bodies seem more "attractive"), and scant clothing. Whether this works is dubious, but common wisdom insists it does.
Characters who are portrayed as popular & well-liked are almost always hinted to be or described as sexually active, and vice-versa — especially if they're the lead. Even their supposed "dry spells" would represent a perfect respectable dating record in real life.
A relative lack of interest in sex is often used to suggest immaturity, piousness, or intellectualism, or a character in denial of their sexual orientation. Meanwhile, desire without success is usually a signifier of unattractiveness or, again, immaturity.
Often this projects a false message to impressionable young people and leads them to believe that having sex will make you happy and solve all your problems in life (and of course, that not having sex is a problem in itself), or it will make you more mature, or will gain you friends. Unfortunately, Real Life generally does not work that way, and people have a tendency to find out about that the hard way (heh).
It doesn't help that the media often project this message alongside its exact counter, leading to more confusion, and a particularly cruel double standard for young women who run the risk of being labelled as "slutty" if they do have sex.
Sadly, there are people who behave as though this trope is true in the real world. Lots of them.