Undated (AP) _ Sexual straying sometimes hits in high ecclesiastical circles, jarring officialdom and the rank and file.

When an ordinary priest or minister gets involved in a sexual tangle, a frequent occurrence according to studies, it's scarcely noticed, and often not publicly at all.

But reactions are intense when it happens to high magisterial prelates, as shown by several recent cases. Careers are toppled and questions swarm about why the respected churchmen let it happen.

''It's individually complicated, but it's related to the collapse of the clerical culture, a collapsing of all hierarchical structures,'' said Eugene Kennedy, a noted Roman Catholic psychologist.

''Supports to a celibate life of authority, prestige and privilege were given when the hierarchical structure functioned, but these do not exist anymore. The rules become more difficult to see and the role is blurred.''

Under the circumstances, he added in a telephone interview, ''these kinds of failures wouldn't surprise me.''

While deviation from the celibacy rule marked recent cases of notable Roman Catholics and that of a Greek Orthodox bishop, it was an extra-marital affair that tripped up an eminent Protestant leader.

The Rev. Allen Boesak, 44, a renowned anti-apartheid leader in South Africa, resigned Aug. 10 as president of the World Alliance of Reformed Churches after admitting a sexual liaison with a television producer.

''A prophet is human and gets scared,'' the repeatedly jailed and threatened Boesak once told American Presbyterians. ''A prophet fails often. He can give in to temptation. And if that happens, who will confront the world?''

Other prominent cases include:

- Roman Catholic Archbishop Eugene A. Marino, 56, of Atlanta, the first black archbishop in the American hierarchy, resigned July 10 after revelations of a two-year ''intimate relationship'' with a young woman singer and lay minister.

- The Rev. Bruce Ritter, 63, founder of New York City's Covenant House and a multimillion-dollar string of shelters for young runaways, resigned last February after accusations of sexual affairs by male youths. An investigative report released in August found he had a consistent pattern of sexual misconduct.

- Greek Orthodox Bishop Anthimos, 57, resigned as head of the church's Denver diocese in 1987 at the behest of Patriarch Dimitrios I of Istanbul, Turkey, after the bishop was accused of seducing a priest's daughter and keeping her in ''sexual servitude.''

In Greek Orthodoxy, priests are allowed to marry, but bishops are vowed to celibacy, as are Roman Catholic priests and bishops.

These four cases involved ecclesiastical heavyweights with honored positions and powerful influence in their churches, a different level than the promotional TV preachers snared in sex scandals.

Jim Bakker, 49, who left his PTL network in 1987 after revelations of extra-marital sex with former church secretary Jessica Hahn and hush money paid to her, was sentenced last fall to 45 years in prison for defrauding contributors.

Jimmy Swaggart, on his TV show in 1988, tearfully confessed ''moral failure'' and a New Orleans prostitute recounted paid sessions with him.

Both Swaggart and Bakker were defrocked by the Assemblies of God, Swaggart after refusing a year-long disciplinary suspension.

The TV preachers, focused on their own individual followings of mostly impersonal and remote audiences, contrast distinctly with high-ranking church dignitaries, but none is immune to sex scandal.

The U.S. Protestant and Eastern Orthodox establishment of the National Council of Churches was rocked in 1983 when former United Bishop James Armstrong resigned both as bishop and as council president, saying he had failed his family and the gospel, later indicating female involvement.

A brilliant, leading member of the French Roman Catholic hierarchy, Cardinal Jean Danielou, 69, died of a brain hemorrhage in 1974 in the Paris apartment of a young go-go dancer and prostitute.

Police and church authorities tried to hush it up but abandoned the attempt after a French weekly published details. Danielou was carrying much cash and some theorized he hoped to buy her freedom from racketeers using her for prostitution.

Kennedy, a much-published professor at Loyola University in Chicago, said that clergymen, as trusted counselors of distressed people seeking solace, are susceptible to sexual involvement if they aren't careful.

''This is common in all the helping professions,'' he said. ''Whenever someone has an emotional need, they quickly transfer that need to the person helping. But counselors are trained to understand what's happening.

''That's what it means to be professional, to accept someone's problem without being entangled in it. If they are, then they are no longer able to help.''