“Survivor” has always reflected society, and what we’ve seen this season demonstrates that we have a long way to go when it comes to dealing with sexual harassment. And just when you thought the producers of “Survivor” and CBS couldn’t possibly handle the issue any worse — they did.

Yes, the harasser — Dan Spilo, a 48-year-old Hollywood talent manager — was finally kicked off the show at the end of the most recent episode. We didn’t see why, and CBS and host/executive producer Jeff Probst are refusing to explain.

We’re left to wonder if the producers and CBS finally did the right thing only because they were afraid that Dan would win the million dollars, creating an even bigger public relations nightmare.

(According to People magazine, the incident that got Dan kicked off involved touching a female crew member’s leg. Dan has reportedly insisted it was accidental.)

Before he was kicked off the show — a first in 39 seasons — viewers saw Dan touching younger, female contestants. They heard female contestants complain about it. They saw one of those women, Kellee Kim, tell Dan to keep his hands to himself in the season premiere. She repeated that several times.

(Photo courtesy of Robert Voets/CBS) Kellee Kim was voted off “Survivor” after she brought up being inappropriately touched by fellow contestant Dan Spilo.

Had he been removed from the show at that point, the long-running series wouldn’t be on the edge of disaster. But at this point, heads should roll. The current management of the series — Probst is both host and showrunner — needs to be replaced, along with the network executives who signed off on a series of bad decisions.

I love “Survivor.” I’ve seen every episode since it premiered almost 20 years ago — 581 and counting. But this season makes me wonder if it isn’t time for the show to go. It’s been uncomfortable, infuriating and almost unwatchable. Among the reasons:

• Video footage of Dan touching, cuddling and rubbing women decades younger than him.

• Contestants Missy Byrd and Elizabeth Beisel — who shared their own stories of Dan’s inappropriate touching — later said they lied about being offended by it to get further in the game. After cynically using a strategy that #MeToo detractors often accuse women of — lying about sexual harassment to target men — they apologized on social media, but the damage was done.

• An off-camera producer disingenuously tells a visibly upset Kellee, “If there are issues, to the point where things need to happen, come to me and I will make sure that it stops.” The show had been filming this since Day 1! Producers knew there were issues!

• A graphic told viewers that producers met with all the contestants, individually and as a group, about inappropriate behavior. Dan “was issued a warning for his behavior” — a fact that was not shared with the other contestants.

• Kellee brought up Dan’s behavior with other contestants. She was the next person voted out. Maybe it wasn’t because she came forward, but it was a terrible optic.

• Worse yet, we saw a smug Dan celebrating her departure.

• When she joined the jury, Kellee was forced to sit silently while several other contestants minimized or dismissed her claims at the next tribal council. Yes, jurors always sit silently, but it was another terrible optic — not to mention a terrible way to treat a woman who had reported sexual harassment.

And it’s worth pointing out that “Survivor” broke precedent by showing earlier footage of Dan touching women repeatedly. And by including audio of that off-camera producer talking to Kellee.

Contestant Aaron Meredith insisted that if anything had actually happened, he would have known about it, adding, “I’ve got two sisters, I’ve got a mother” — an incredibly lame and sexist response. (He, too, later tearfully apologized on social media.) Even more disappointing was the response of women contestants who denigrated Kellee.

Probst knew exactly what happened — but he remained silent, keeping the show’s warning to Dan a secret from the contestants as they disparaged Kellee.

In that vacuum, Dan got indignant and offered lame apologies — including that he was innocent because “I work in an industry in which the #MeToo movement was formed and allowed — thank God — to blossom and become powerful and strong.” To claim you’re innocent because you work in the entertainment industry is mind-boggling.

In that next episode, Jamal Shipman — the one contestant who offered an intelligent defense of Kellee — was voted out.

Then all of this was basically ignored for five episodes. Dan’s 13-year-old son was even allowed to appear; that poor kid (and his brother) must be getting teased mercilessly.

In the wake of Dan’s ouster, Kellee posted this online:

“CBS and ‘Survivor’ were on notice of Dan’s behavior from the very first days of the game. And, as ‘Survivor’ fans know, shortly after I spoke up on camera, I was voted off the show. Since then, I’ve accepted genuine, heartfelt apologies from fellow castaways, but I’ve continued to feel disappointed by how this pattern of behavior was allowed to occur for so long.”

Exactly. CBS and “Survivor” failed her, and failed all women. And Probst’s promises that he and the production team have learned from this season ring hollow — they failed to act for weeks.

Remember, this took place on the network whose longtime chief, Les Moonves, was fired because of sexual harassment. (Charges he denies.) CBS has dealt — generally badly — with sexual harassment on “Big Brother,” “Bull,” “CBS This Morning” and “60 Minutes.” And there are allegations involving staff at CBS-owned TV stations.

“Survivor” ends its 39th season on Wednesday (7 p.m., Ch. 2) with another first. The reunion show won’t be live in the eastern half of the country for the first time; it will be taped earlier in the day — apparently so the contestants’ comments can be edited.

It’s all just infuriating.