William J. Broad is the author of “The Science of Yoga: The Risks and the Rewards,” published this month by Simon & Schuster.

The wholesome image of yoga took a hit in the past few weeks as a rising star of the discipline came tumbling back to earth. After accusations of sexual impropriety with female students, John Friend, the founder of Anusara, one of the world’s fastest-growing styles, told followers that he was stepping down for an indefinite period of “self-reflection, therapy and personal retreat.”

Friend preached a gospel of gentle poses mixed with openness aimed at fostering love and happiness. But Elena Brower, a former confidante, has said that insiders knew of his “penchant for women” and his love of “partying and fun.”

Few had any idea about his sexual indiscretions, she added. The apparent hypocrisy has upset many followers.

“Those folks are devastated,” Brower wrote in The Huffington Post. “They’re understandably disappointed to hear that he cheated on his girlfriends repeatedly” and “lied to so many.”

But this is hardly the first time that yoga’s enlightened facade has been cracked by sexual scandal. Why does yoga produce so many philanderers? And why do the resulting uproars leave so many people shocked and distraught?

One factor is ignorance. Yoga teachers and how-to books seldom mention that the discipline began as a sex cult — an omission that leaves many practitioners open to libidinal surprise.

Hatha yoga — the parent of the styles now practiced around the globe — began as a branch of Tantra. In medieval India, Tantra devotees sought to fuse the male and female aspects of the cosmos into a blissful state of consciousness.

The rites of Tantric cults, while often steeped in symbolism, could also include group and individual sex. One text advised devotees to revere the female sex organ and enjoy vigorous intercourse. Candidates for worship included actresses and prostitutes, as well as the sisters of practitioners.

Hatha originated as a way to speed the Tantric agenda. It used poses, deep breathing and stimulating acts — including intercourse — to hasten rapturous bliss. In time, Tantra and Hatha developed bad reputations. The main charge was that practitioners indulged in sexual debauchery under the pretext of spirituality.

Early in the 20th century, the founders of modern yoga worked hard to remove the Tantric stain. They devised a sanitized discipline that played down the old eroticism for a new emphasis on health and fitness.

B.K.S. Iyengar, the author of “Light on Yoga,” published in 1965, exemplified the change. His book made no mention of Hatha’s Tantric roots and praised the discipline as a panacea that could cure nearly 100 ailments and diseases. So, modern practitioners have embraced a whitewashed simulacrum of Hatha.

But over the decades, many have discovered from personal experience that the practice can fan the sexual flames. Pelvic regions can feel more sensitive and orgasms more intense.

Science has begun to clarify the inner mechanisms. In Russia and India, scientists have measured sharp rises in testosterone — a main hormone of sexual arousal in both men and women. Czech scientists working with electroencephalographs have shown how poses can result in bursts of brainwaves indistinguishable from those of lovers. More recently, scientists at the University of British Columbia have documented how fast breathing — done in many yoga classes — can increase blood flow through the genitals. The effect was found to be strong enough to promote sexual arousal not only in healthy individuals but among those with diminished libidos.

In India, recent clinical studies have shown that men and women who take up yoga report wide improvements in their sex lives, including enhanced feelings of pleasure and satisfaction as well as emotional closeness with partners.

At Rutgers University, scientists are investigating how yoga and related practices can foster autoerotic bliss. It turns out that some individuals can think themselves into states of sexual ecstasy — a phenomenon known clinically as spontaneous orgasm and popularly as “thinking off.”

The Rutgers scientists use brain scanners to measure the levels of excitement in women and compare their responses with readings from manual stimulation of the genitals. The results demonstrate that both practices light up the brain in characteristic ways and produce significant rises in blood pressure, heart rate and tolerance for pain — what turns out to be a signature of orgasm.

Since the baby boomers discovered yoga, the arousal, sweating, heavy breathing and states of undress that characterize yoga classes have led to predictable results. In 1995, sex between students and teachers became so prevalent that the California Yoga Teachers Association deplored it as immoral and called for high standards.

“We wrote the code,” Judith Lasater, the group’s president, told a reporter, “because there were so many violations going on.”

If yoga can arouse everyday practitioners, it apparently has similar, if not greater, effects on gurus — often charming extroverts in excellent physical condition, some enthusiastic for veneration.

The misanthropes among them offer a bittersweet tribute to yoga’s revitalizing powers. A surprising number, it turns out, were in their 60s and 70s.

Swami Muktananda (1908-82) was an Indian man of great charisma who favored dark glasses and gaudy robes.

At the height of his fame, around 1980, he attracted many thousands of devotees — including movie stars and political celebrities — and succeeded in setting up a network of hundreds of ashrams and meditation centers around the globe. He kept his main shrines in California and New York.

In late 1981, when a senior aide charged that the venerated yogi was in fact a serial philanderer and sexual hypocrite who used threats of violence to hide his duplicity, Muktananda defended himself as a persecuted saint, and soon died of heart failure.

Joan Bridges was one of his lovers. At the time, she was 26 and he was 73. Like many other devotees, Bridges had a difficult time finding fault with a man she regarded as a virtual god beyond law and morality.

“I was both thrilled and confused,” she said of their first intimacy in a Web posting. “He told us to be celibate, so how could this be sexual? I had no answers.”

To denounce the philanderers would be to admit years of empty study and devotion. So many women ended up blaming themselves. Sorting out the realities took years and sometimes decades of pain and reflection, counseling and psychotherapy. In time, the victims began to fight back.

Swami Satchidananda (1914-2002) was a superstar of yoga who gave the invocation at Woodstock. In 1991, protesters waving placards (“Stop the Abuse,” “End the Cover Up”) marched outside a Virginia hotel where he was addressing a symposium.

“How can you call yourself a spiritual instructor,” a former devotee shouted from the audience, “when you have molested me and other women?”

Another case involved Swami Rama (1925-96), a tall man with a strikingly handsome face. In 1994, one of his victims filed a lawsuit charging that he had initiated abuse at his Pennsylvania ashram when she was 19. In 1997, shortly after his death, a jury awarded the woman nearly $2 million in compensatory and punitive damages.

So, too, former devotees at Kripalu, a Berkshires ashram, won more than $2.5 million after its longtime guru — a man who gave impassioned talks on the spiritual value of chastity — confessed to multiple affairs.

The drama with Friend is still unfolding. So far, at least 50 Anusara teachers have resigned, and the fate of his enterprise remains unclear. In his letter to followers, he promised to make “a full public statement that will transparently address the entirety of this situation.”

The angst of former Anusara teachers is palpable. “I can no longer support a teacher whose actions have caused irreparable damage to our beloved community,” Sarah Faircloth, a North Carolina instructor, wrote on her website.

But perhaps — if students and teachers knew more about what Hatha can do, and what it was designed to do — they would find themselves less prone to surprise and unyogalike distress.