“Baywatch,” starring Dwayne Johnson and Zac Efron, is a stupidly entertaining trash folly, the kind that could only be made today: an obscenity-and-insult-laced, aggressively “competent” adaptation of a 25-year-old TV show that manages to repackage every aspect of the series except, perhaps, the reason it was popular in the first place. And what was that reason? If Rodney Dangerfield were around, he might say, “There were two reasons!” But actually there’s a bit more to it.

“Baywatch,” which premiered at the tail-end of the 1980s (and stumbled out of the gate, becoming a hit in syndication the way “Star Trek” did), was a muscle-beach soap opera that anticipated the sexy-youth-kitsch-for-adults appeal of “Beverly Hills 90210.” It was also an L.A. crime series where the law enforcers wore spandex swimwear; a cheeseball star vehicle that revamped the camp-stud Ken-doll mystique of the former “Knight Rider” hero David Hasselhoff; and, yes, an entry in the oxymoronic genre that started a decade before with “Charlie’s Angels” — the prime-time jigglefest.

“Charlie’s Angels” had taken the primped poutiness of ’70s porn goddesses and fed it right into the image of Farrah Fawcett, turning her into a frosted-hair icon of mainstream erotic bliss. “Baywatch,” through the character of Pamela Anderson’s C.J. Parker, did the same thing for the platinum-blonde, cosmetically enhanced, overpriced-party-doll look of the porn stars of the ’80s. You couldn’t show a lot on network TV, but the legendary slow-mo shots of Anderson on the run helped to make “Baywatch” a megahit around the world.

But where does that leave a 2017 movie? The appetite for sanitized cheesecake now seems as trapped in a lost age as an old issue of Playboy — and besides, our era is a little more advanced. Those slow-motion shots are referenced in the movie, but only as a dismissive one-liner. C.J., now played by the non-cartoonish but also slightly colorless Kelly Rohrbach, and her fellow “babe” lifeguard, Summer Quinn (Alexandra Daddario), are smart, hip, centered, and self-aware; they’re 21st-century women who aren’t about to turn into pin-up fodder for losers. They wear their butt-hugging red bathing suits with dignity and pride, which makes this a highly sexually responsible “Baywatch.” C.J., shorn of Anderson’s hardened troubleshooter façade, is so sweet that she actually likes Ronnie (Jon Bass), the jelly-bellied mega-dork who’s got a crush on her. Of course, you might ask: Where’s the fun in that?

“Baywatch,” as a series, now looks jaw-droppingly goofy and harmless (actually, it did then too), and the movie would have been smart to satirize the show’s innocuous underworld drama and cheeseball male gaze, playing up the dated absurdity of it all. But no: The film’s director, Seth Gordon (“Identity Thief”), and its screenwriters, Damian Shannon and Mark Swift, have glommed “Baywatch” onto the theme of the moment: namely, that a bunch of good-looking SoCal lifeguards, devoted to keeping their beach a safe cool magical place, are just like — wait for it! — a family.

Mitch Buchannon (Johnson), the hard-bodied hulk who’s so devoted to his mission that he’s like a drill sergeant crossed with the Buddha, leads a motley crew of lifeguards who seem more than a little like the drag-race crime fighters from the “Fast and Furious” films. They just happen to have safety whistles instead of cars. The first half of the movie goes by in a blur of fractious high spirits, as Matt Brody (Efron), a disgraced bad boy of an Olympic swimmer, tries out for the elite team of lifeguards watching over Emerald Bay. Matt thinks he has automatic entré, because he’s got two gold medals to his name, but actually he has a lot to prove. He was nicknamed “the Vomit Comet” for the moment he ralphed in the pool during an Olympic relay and became an instant national joke.

Mitch is now going to make him earn his place, and their caustic interplay gives the film a sparky buzz of tension. Dwayne Johnson can seem like Tony Robbins playing Superman, but he never phones in a line. His delivery cracks like a whip, so that each time he calls Matt by the name of another boy band, the joke stays fresh.

The plot, however, does not. Mitch has found packets of drugs on the beach; one missing city official and mysterious blazing yacht fire later, it’s clear that there’s a larger criminal scheme in play. Gee, could it have something to do with Victoria Leeds (Priyanka Chopra), the new owner of the Honda Club? Chopra, the crossover Bollywood star, preens and schemes like a vamp from “Dynasty,” and the whole drugs-and-real-estate plot has a musty air of sub-“Miami Vice” intrigue — it’s closer to “Starsky and Hutch.” The trouble is that the movie plays it boringly straight. Seth Gordon, the documentarian-turned-high-concept-comedy-director, throws in one grossly funny scene, in which Mitch and Matt are examining a corpse in the morgue and Mitch — for no good reason — forces Matt to poke around the corpse’s genitals. It’s a conversation-piece gag (in every sense) implanted there to sell the movie, but it’s completely incongruous.

Zac Efron, with his abs so sculpted he’s gone way past a six-pack (it’s more like a checker board), has figured out a way to turn being the beefcake butt of the joke into a shaggy dumb/smart style. That, however, is a joke that could get old fast. And it’s worth noting: In the second half of “Baywatch,” Johnson’s Mitch gets knocked out of the action for a while, and when he does, the movie goes thud. Was it really The Rock who was holding it all together? That and our nostalgic affection for “Baywatch,” which in a movie like this one becomes a form of living off vapors.