Inside the Castle, it looks as if Smithsonian officials are standing on principle: An exhibition of art owned by Bill and Camille Cosby, on display at the National Museum of African Art, is not an endorsement of Cosby’s character, behavior or reputation. This is about the art, and the artists, not the collector, who is accused of sexually assaulting more than 40 women and who acknowledged in a 2005 legal deposition that he intended to give drugs to women he wanted to have sex with.

Although Cosby’s name appears dozens of times throughout the exhibition, the Castle will not take it down before the scheduled end of its run in January 2016. To do otherwise, they say, would set a bad precedent and open the institution to public pressure from interest groups far and wide who disagree with or dislike anything on display.

“Exhibits have an intellectual product,” said Richard Kurin, the Smithsonian’s undersecretary for history, art and culture. “That’s why we put them up. So when it’s up, we are loath to take them down.”

It’s not a bad principle, and it shows that the Smithsonian learned something from its last major exhibition controversy, the decision by then-Smithsonian Secretary Wayne Clough to censor a 2011 exhibition of gay and lesbian portraiture at the National Portrait Gallery. That blunder opened the Smithsonian to furious criticism, demonstrated its willingness to capitulate to homophobic slander and did real violence to one of the best and most critically well-received exhibitions it had mounted in a decade or more.

But although Kurin says the institution’s leadership learned a valuable lesson in 2011, it hasn’t learned when this newfound wisdom applies. Although the Castle developed guidelines to address the issue of tampering with or censoring exhibitions, it seems unaware that for every rule there are exceptions. Cosby isn’t guilty of insider trading, or securities fraud, or driving drunk; he stands accused of raping or having inappropriate sexual contact with dozens of women — allegations he has denied. The exhibition was paid for by, and celebrates in myriad ways small and large, a man who, many women alleged, not only sexually assaulted them but in some cases sought to silence them. It is called “Conversations.”

This isn’t about borrowing art from an unsavory rich guy; it’s about hosting an exhibition that celebrates the family life and character — “the personal importance of family to the collectors cannot be overstated,” reads one exhibition text — of a married man who by his own admission acquired Quaaludes to give to women he wanted to have sex with.

And so the big crisis of the last Smithsonian secretary leads directly to the first crisis of the new one, David Skorton, who took over the institution at the beginning of this month. And once again, the Smithsonian looks desperately out of touch. When Clough censored the gay-and-lesbian-themed exhibition, “Hide/Seek,” American society was in the middle of an astonishingly rapid change of heart about anti-gay prejudice; Clough’s blunder will probably be remembered as the last great capitulation in the dying culture wars over sexual identity and expression.

Now the Smithsonian has chosen to stand behind an exhibition celebrating a collector who personifies the nexus of power, wealth and celebrity that allows too many men of high social standing to treat women with violence and impunity. Once again, the culture is rapidly shifting, and the Smithsonian seems to have no idea how its support of the Cosby exhibition looks to the outside world. The public discourse over rape today is different than it was five or 10 years ago. Today, women, and society at large, not only seek to utterly eradicate it but also to shame those who deny it or issue apologetics.

“Conversations” was a bad idea for an exhibition in the first place, and it violated widely held ethical standards in the museum world that warn against displaying the art of living collectors unless that art has been given or bequeathed to the museum. Although the Smithsonian says that it will acknowledge the Cosby controversy with an informational sign, it hasn’t yet done so. And so the exhibition remains an exercise in hagiography, full of soft-focus and flattering images of the Cosbys, a painting by their daughter and multiple citations from the couple explaining their love of art.

I revisited the exhibition to remind myself how visible Cosby is in it. After 40 appearances of his name, I stopped counting. Worse, the institution has played down the financial relationship between the Cosbys — who donated more than $700,000 to the African Art Museum — and the institution. Although the Smithsonian asserts that the Cosbys’ underwriting of the museum was “publicly available information,” a museum spokesman didn’t divulge the information when asked a direct question by The Post in an e-mail exchange last November. Only later did it acknowledge this connection to The Post and the Associated Press.

It’s understandable that a large cultural institution is wary of being swayed by sudden moves in public opinion. But rape isn’t like other crimes, and it is directly related to the history of art and the use of art to defend male privilege. It has been 40 years since Susan Brownmiller published “Against Our Will,” which argued that rape “is nothing more or less than a conscious process of intimidation by which all men keep all women in a state of fear.” That might seem hyperbolic unless you’ve spent time in an art gallery, where rape is routinely glorified and eroticized. Art is so enslaved to rape culture that it has its own tropes for discrediting women who have been raped: Just look at Rembrandt’s painting of “Joseph Accused by Potiphar’s Wife,” recounting the false accusation of rape against the biblical patriarch. It is one of perhaps a dozen such images in the National Gallery of Art.

Rape is already inescapable in art museums, which is why the museum should be more sensitive to its Cosby connections. No matter what the Smithsonian asserts, the Cosby exhibition is now inextricably tied to women’s portrayal of Cosby as a sexual predator. Its casual celebration of patriarchy and traditional female role models will be read in context of women who claim that he allegedly used drugs to incapacitate them. Once you start looking for rape as a subtext, it leaps out at you with a shocking sense of the obvious.

In the popular, representational imagery preferred by the Cosbys — to the virtual exclusion of socially, politically or racially provocative art — women are represented as tortilla makers, flower bearers, sexual objects, faithful mothers or fertility figures. Only one painting lent by the Cosbys, Robert Colescott’s 1991 “Death of a Mulatto Woman,” directly engages issues of identity, race and femininity in a sophisticated way, and it is wildly ambiguous, seemingly to posit a connection between mixed racial identity and sexual availability or vulnerability.

Rape thrives on silence and on the ability of men to silence women. Sexual abuse of all sorts thrives within the family, where emotional cohesion, obedience and loyalty are all too often deployed to bury abuse in collective silence. The family themes of the Cosby exhibition — an extension of the fictional family-friendly brand that made Cosby wealthy — now look like an elaborate veil cast over the abuses of the patriarch. Was rape ever a topic of conversation in the house?

Why, in the Cosby-owned painting “Homage to 466 Cherry Street,” by Eldzier Cortor, does a magazine spill out of a mailbox with what appears to be a mostly naked African American woman on the cover? And is the title of the magazine, “Artist Digest,” a comment on the use of art to mask illicit desire?

Little things, maybe entirely innocent, look different in this context. What to make of a quilt that includes a panel with these words on it: “What about the word no don’t you understand?”

At this point, there is no risk of over-psychologizing the exhibition. It never had any substantial content to begin with, but at least now it can be used as a case study in how women are treated in art and how art supports a cultural infrastructure of contempt, dehumanization and misogyny. Art objectifies women; it allows us to ogle them under the pretense of purely aesthetic pleasure; it defines them romantically and sentimentally as servants and helpmates to men; it punishes them for transgressing their proper role.

If you invest in these images, they will grow in value, especially if you can persuade a respectable museum to display them. And as they grow in value, so, too, your stature will grow. And who would believe a woman’s testimony next to that of a successful art collector?