In 2017, Simon & Schuster canceled a book by the professional provocateur Milo Yiannopoulos after he gave an interview in which he appeared to condone pedophilia. His contract reportedly did not include a morality clause, and he sued, though he later dropped the suit. If a morality clause did lead to a book’s cancellation, we probably wouldn’t know it, according to Devereux Chatillon, a partner in the media and intellectual property law firm Chatillon Weiss who has represented both The New Yorker and writers. “It wouldn’t be public unless somebody sued over it,” she said. And even then, the lawsuit probably wouldn’t come to light.

Morality clauses may be relatively new to mainstream publishing, but they have a long history. The entertainment industry started drafting them in 1921, when the silent-movie star Fatty Arbuckle, who had just signed a then-astonishing $1 million contract with Paramount Pictures, was accused of the rape and manslaughter of a girl at a party. Mr. Arbuckle was acquitted after two mistrials , but by then the public had soured on him, and the studios wanted out.

Today the clauses are widespread in sports, television and advertising. Religious publishers have used them for at least 15 years, which seems fair enough. You can’t condemn a Christian publisher that cancels publication of a book called “The Ridiculously Good Marriage” after the author is accused of having sexually assaulted an underage girl when he was a youth pastor. (He apologized for a “sexual incident.”) Children’s publishers have been including the clauses for a decade or more, and they, too, have a case. It would be challenging to sell a children’s book written by a pedophile.

Maybe you don’t find morality clauses alarming under any circumstances. “If what you’re selling me is your reputation, if that’s what I’m paying you for, then I should not have to pay you” if your reputation tanks, said Rick Kurnit, a partner in Frankfurt Kurnit Klein & Selz, a firm specializing in art and entertainment law.

Maybe you’re asking: Why should anyone get away with being a racist or sexist jerk? What gives Mr. Alexie, accused of hitting on women who saw him as a mentor, and Mr. Díaz, accused of forcibly kissing someone, the right to have their books published? Or even: Why should opinion writers be allowed to gratuitously insult duly elected officials? If a loudmouth suffers from a backlash, this reasoning goes, he probably deserves it.

The problem with letting publishers back out of contracts with noncelebrity, nonreligious, non-children’s book authors on the grounds of immorality is that immorality is a slippery concept. Publishers have little incentive to clarify what they mean by it, and the public is fickle in what it takes umbrage at.

In 1947, the concern was Communism, and morality clauses gave studios a way to blacklist the Hollywood 10, a group of directors and screenwriters who denounced the House Un-American Activities Committee as illegitimate and refused to say whether they’d ever been Communists. All 10 went to jail, and all but one, who decided to cooperate with the committee, became unemployable until the 1960s, though some continued to write under pseudonyms.