The posting of pilfered intimate celebrity photos last week was a reminder of the anomaly of stardom: A star’s entire life is directed to attracting attention to himself or herself — until that moment when they suddenly announce “leave me alone.”

While we civilians understand why stars are upset when their private photos go viral — especially when someone steals them from their phones — what most of us don’t get is why they posed for them to begin with. Rampant narcissism, it seems, keeps intruding on privacy.

Yet this is hardly a new conundrum. Marilyn Monroe’s naked photos became a pocket industry. I was once offered photos supposedly taken by Charlie Chaplin of one of his underage “dates.” I hastily declined.

A huge stash of star photos was allegedly included in King Farouk’s mythic library of assorted porn — the portly Egyptian monarch was the biggest collector in the world, though he claimed the Vatican library inadvertently ran a close second. Farouk’s photos ultimately fell into the hands of Alfred Kinsey as part of his research on sexual behavior.

So while reps for Jennifer Lawrence, Kirsten Dunst and Kate Upton might protest that their privacy was violated, “violations” of this sort have been going on forever. If anything, the motivations seem tamer this time — more like exercises in titillation and geek mischief, not extortion, as in previous generations.

In the 1940s and 1950s, scandal sheets like Confidential and Whisper routinely threatened to publish salacious photos of stars like Rock Hudson, Tab Hunter or Guy Madison. It was considered certain career death for a romantic lead to be identified as gay, and usually a payoff made the photos disappear. Still, reps for Cary Grant and Randolph Scott were furious when the story went public that they shared an apartment in Hollywood, and photos appeared that seemed to document their (fully clothed) domestic bliss.

Mike Connolly, a gay gossip columnist for the Hollywood Reporter, relished torturing Hunter with items about his presence at all-male pajama parties and dances. In that era, it was a violation of the penal code for men to dance with other men in public places.

Studio publicists were skilled at countering these allegations with hastily arranged marriages, such as Hudson’s to Phyllis Gates, which occurred shortly after the release of “Giant.” Photos of these events were aggressively circulated to the press.

Some 40 years later, some the elements of scandal had changed, but not others. Rob Lowe became the inadvertent star of stolen videotapes as a result of his encounter with two girls at a political convention (one was 16 years old) and a second incident in Paris. An agile and witty interview subject, Lowe managed his own crisis control, and escaped with no apparent lasting career damage.

Given their celebrity, why do stars allow themselves to get into such situations? Sometimes it’s a question of artistic seduction. The great photographer Helmut Newton once told me he could not remember being turned down by a star for a photo shoot, even when the set-up was risque. To be sure, some of his photos are masterful, albeit prurient.

But the main motivation for stars’ willingness to let such photos be taken is simple narcissism. Despite their public protestations, the reality is that they like being looked at. They like looking at themselves. They just don’t like the public to horn in on their fun and not pay for it.