Sexual harassment from an employee is unacceptable.

That’s an uncontroversial statement in 2017, one that nearly every modern company would agree with. But at 21st Century Fox, owner of Fox News, it was seen as a dilemma. Fox News’s most lucrative star, host Bill O’Reilly, was accused of a pattern (paywall) of sexual harassment dating back more than a decade. O’Reilly wasn’t just a cash cow for Fox: He was the tribune of its core audience and a key to the network’s identity—a conservative white man with little patience for progressive values and contemporary culture.

Weighing against loyalty to O’Reilly and his millions of viewers was the perception of Fox by advertisers —who were abandoning “The O’Reilly Factor” in droves—investors, and current and future employees, particularly women.

Fox was already struggling to combat its reputation as a workplace that tolerated sexual harassment in the aftermath of allegations of similar behavior by former Fox News chairman Roger Ailes. The company ousted Ailes last year and agreed to settle lawsuits brought by former anchor Gretchen Carlson and other female employees. Another star, Megyn Kelly, left the company for NBC due in part to the defensive response many of her Fox colleagues had to the Ailes allegations.

Fox also risked losing its female audience: According to a poll conducted by Morning Consult April 13-15, 48% of women—and 35% of Republican women—believed Fox should cancel O’Reilly’s show.

While Rupert Murdoch, executive chairman of 21st Century Fox, was reportedly in favor of keeping O’Reilly, his sons, James and Lachlan, argued it was time for him to go. In a memo to employees, the senior Murdoch paid respect to O’Reilly’s success, but said the company was committed “to fostering a work environment built on the values of respect and trust.”

In a statement April 19, O’Reilly called the accusations against him “completely unfounded.”

Fox may have had other considerations in mind, as well: 21st Century Fox is bidding to take over the 61% of Sky, a European telecom, it doesn’t own, and must prove to UK regulators the company is “fit and proper” to own a British broadcast license.

This isn’t the first time the Murdochs have sacrificed a valuable asset to protect their long-term business interests. In 2011, they shut down the immensely profitable Sunday tabloid News of the World to contain damage from a mushrooming phone hacking scandal.

Rather than mourn the revenue lost from the News of the World, the Murdoch’s News Corp. began publishing another tabloid, The Sun, on Sundays to fill the gap. Replacing O’Reilly may be more challenging, but a necessary cost of doing business.