Root around the history of Hollywood, and you won't find many too stars with a cleaner, more wholesome reputation than Jimmy Stewart. But that, hasn't stopped his latest biographer from digging up the dirt.

Marc Eliot, author of a previously acclaimed biography of Cary Grant, says the notoriously tyrannical MGM boss, Louis B Mayer, was so concerned about the young Stewart's apparent lack of interest in ladies he forced him to visit a brothel so people wouldn't start gossiping that he was gay.

The episode may say more about the glorious clash between Hollywood licentiousness and American puritanism than it does about Stewart. But it also opens a window on an era when actors and their reputations were effectively owned by the studios that held their contracts, and subject to extraordinary manipulations.

Download the new Independent Premium app Sharing the full story, not just the headlines

Stewart, of course, was not gay, or even bisexual. As his career progressed, he had affairs with Loretta Young and Marlene Dietrich before settling down at 40 with divorced socialite Gloria McLean, with whom he lived happily ever after.

But when he was 25, his very blamelessness was cause for concern. "I had to lay down the law to him," an MGM scout called Bill Grady told Eliot. "I had to tell him, 'Jim, if you don't go and give a manly account of yourself at least a few times, Mayer and the others will think you're gay.'"

Mayer owned a private brothel just off the MGM lot, creating a discreet locale where the talent could misbehave in the secure knowledge that word would not reach the gossip columnists and entertainment magazines. Grady told Stewart: "Get your ass over there and get those rocks off with at least two of those broads." And, the biography says, Stewart reluctantly did.

This was the 1930s, and Hollywood stars had reputations to maintain, for financial reasons under the studio system as well as moral ones. If they were exposed as homosexuals, or deviants, or ran foul of the law, it spelt trouble at the box office and frequently ended careers.

The studios and talent agencies such as MCA ran interference where necessary. MCA successfully covered up Clark Gable's drunk-driving arrests, and Bette Davis's apparent participation in the manslaughter death of her second husband. In the 1950s, studio publicists played up Montgomery Clift's friendships with theatre actresses rather than acknowledge that he was gay, just as they had previously played up Cary Grant's five marriages (to deflect attention from the beach house Grant shared with fellow actor Randolph Scott.

Gossip columnists, notably Hedda Hopper and Louella Parsons, acted as de facto spies for the studios, digging up more dirt than they published, which the studios used as leverage to pressure their contract players into behaving themselves. "The studios' monitoring and regulatory measures, including 'morals' clauses in contracts, was essentially an economic, rather than a moral directive," Eliot said. "The studios did what they had to do to insure their stars, and in many cases that meant more than taking out life insurance policies." But trangression was common. Errol Flynn was notorious for drinking, fighting and sleeping with underage girls. (He was tried three times on separate statutory rape charges.) At one Hollywood party, Flynn tapped out "You Are My Sunshine" with his famously well-endowed penis on a piano keyboard.

Joan Bennett's career ended in 1951 after her husband discovered she was having an affair with her agent and shot her lover in the testicles.

Tellingly, neither the husband, an independent Hollywood producer who strayed from the marriage long before she did, nor the lover suffered significant setbacks to their own careers.