For the past half-century, I have been reading and studying the sources of Hasidism with both affection and respect. I have worked as a historian of Hasidic thought and, more recently, as a theologian trying to construct a contemporary Judaism on the basis of Hasidic insights. Like the Hasidic master Pinhas of Korzec, who once thanked God that his soul came into the world after the Zohar was revealed “because the Zohar kept me a Jew,” I know that I owe my own Judaism primarily to the Baal Shem Tov and his followers.

Over this same time period, however, I have looked with growing dismay at contemporary Hasidism and the various positions it has taken on matters of concern to all Jews. The latest, and most ridiculously degrading, incident is the flap about Ashkenazic-Sephardic integration that is convulsing Israel. At the center of the current furor is the ultra-Orthodox Beit Yaakov school in the West Bank town of Immanuel, where mostly Sephardic girls were literally walled and fenced off from the mostly Ashkenazic girls in the school’s Hasidic track, with religious differences offered as the justification.

I laughed and cried when reading that, in order to attend the school’s Hasidic track, Sephardic girls were required to daven, even at home, using the Ashkenazic pronunciation of Hebrew. How many recall that the Hasidim (themselves Ashkenazim) were once fiercely denounced for adopting Sephardic versions of Jewish prayers, then thought to reflect a higher level of sanctity?

What happened to Hasidism? How did a daring and innovative movement for the spiritual regeneration of Judaism turn into a hard core of embittered defenders of a lost past, squabbling constantly among themselves, producing headline-grabbing violators of Jewish ethical norms, and viewing the outside world as entirely defiled and hostile?

To understand how Hasidism went astray, we need to know its history, including some flaws that were present from the outset.

The goal of the Baal Shem Tov’s followers was a Jewish life refocused on such essentials as the love of God, the joy of living out God’s commandments and the faith that divinity was to be found everywhere. The Jew’s task was to seek sparks of holiness throughout creation and to return them to their root, meanwhile celebrating the privilege of this life of holiness. Divinity was to be found in fields and forests, in the letters of the Torah, and in the Jewish heart.

Left out of the equation was the non-Jewish human community in whose midst the Hasidim lived. It is easy to say that Polish and Ukrainian Christianity, filled with anti-Semitic stereotypes, dehumanized the Jew, and we merely returned the favor. But the history is more complex. The view that gentiles are less fully human than Jews, even said to be lacking the divine soul, had ancient roots in kabbalistic tradition. Sadly, that bit of racist Jewish folklore is alive among the Hasidim (and a few others!) even today. Although it should have nothing to do with internal Jewish divisions, since the unity of Jews is also a cardinal principle, we know that the stain of racism is one that tends to spread.

Two other developments that led to the decline and even degeneration of Hasidism can be attributed to decisions made in the course of its history.

The first is dynastic leadership. The idea that a holy man’s charisma could be passed down to sons and grandsons — instead of the obvious, and more inherently Jewish, choice of master-to-disciple — began in a few key families of Hasidic lineage at the turn of the 19th century. The grandsons and great-grandsons of Hasidic tzaddikim quarreled with one another over loyalties, over doctrines, but especially over money. As the numbers of dynastic claimants swelled, the movement came to be seen as characterized by pettiness and increasingly weak and uninspired leadership. While a few great latter-day figures proved exceptions, the rule was that the quality and originality of those at Hasidism’s helm was already in sharp decline over a hundred years ago.

The second development stems from the Hasidic movement’s response to modernity.

When the brash new Hasidic movement first appeared on the stage of history, the rabbinic leadership of Eastern Europe, famously including the Vilna Gaon, was outraged. For 30 years, beginning in 1772, these mitnagdim — Hasidism’s “opponents” — would excommunicate anyone who had anything to do with the Hasidim. But by 1810, the rabbinic leadership began to feel the pressure of a much more dangerous enemy, that of Haskalah, or Jewish enlightenment. The rabbinic leaders then made common cause with the Hasidim to fight modernity.

The Hasidim, anxious to please their one-time persecutors, enthusiastically led the charge. The Baal Shem Tov’s world-embracing legacy was turned into a weapon with which to bludgeon anyone who dared deviate, whether in religious practice, educational views or even in style of dress, from the norms of the 18th century.

This is the Hasidism that got carried forward into succeeding generations. As the struggle became fiercer, especially once it involved governmental pressures, Hasidic anti-modernism turned spiteful, justifying techniques of resistance that are no source of pride.

By the 20th century, the battle was mostly lost, and children of Hasidim by the drove were turning toward various secular Jewish movements, including Zionism. The surviving Hasidic movement then turned toward politics, creating the Agudat Yisrael movement and other bodies that sought to defend the ever-receding turf of Hasidic and ultra-Orthodox domination.

World War I, the terrible pogroms that followed it and Sovietization ravaged Hasidism in Eastern Europe. Hitler did the rest. By 1945 there seemed to be almost nothing left.

Then the most remarkable period of Hasidic history began to unfold. Out of the Holocaust’s ashes, the community began to rebuild itself.

The fiercely anti-Zionist Satmar rebbe, Joel Teitelbaum, re-created a large chunk of pre-war Hungary in Williamsburg and Jerusalem. The surviving Bobover scion, Solomon Halberstam, who had lost nearly all of his following, reached out to surviving Hasidim who had lost their own rebbes to re-build Galicia, first in Crown Heights, then in Boro Park. The Lubavitchers had an active underground network that was keeping some sparks of Torah alive in the Soviet Union. The Lubavitchers — eventually followed by the Bratslavers — reached out, often with some success, to the children of modern Jews. The Gerer and Belzer rebbes, both rescued in the midst of the Holocaust, rebuilt their empires around grand fortresses in Jerusalem, then conquered ever-larger swaths of Israel.

All of this happened with the support of other Jews, very prominently including the government of Israel. We were all deeply moved and impressed by the faith-energy displayed by this old-new Jewish community, committed to reconstituting itself in new and uncomfortable surroundings. Impressive natural increase, in contrast to the rest of us remarkably infertile Jews, helped the postwar Hasidim regain significant numerical representation within world Jewry. Israeli military draft exemption laws worked to create a huge society of largely idle Hasidic males, supposedly full-time Torah students, a phenomenon completely unlike anything in earlier Hasidic history.

With Hasidim accustomed to viewing all outsiders through the lens of Eastern European hostilities, the Hasidism that has emerged is a strange combination of inner-directed love and joy, an inheritance from the movement’s first period; uncompromising and often hysterical degrees of ultra-Orthodox extremism, combined with shrill denunciations of all other Jews, coming from the second era of Hasidic history; and disdain for the non-Jewish world, the legacy of persecutions old and new.

Of course, there are still sparks of holiness to be found among the Hasidim. There are young people at the edges of Hasidism still concerned with the real struggle for avodat Hashem, true worship. But most of the movement is pure imitation and entrenchment in the past. As the Kotzker rebbe taught long ago, a Hasid by dint of imitation is an imitation Hasid.

How shall we who love Hasidism, who still pore over such writings as the “Kedushat Levi” or the “Sefat Emet” to find inspiration, relate to the narrowly exclusivist, self-righteous and intolerant version of Judaism that is one face of contemporary Hasidism? The answer is that we need to rescue the Baal Shem Tov from his latter-day followers. The religion of today’s Hasidim, themselves victims of a tragic and complex history, cannot be allowed to stand as Hasidism’s only legacy.

Rabbi Arthur Green is rector of the Rabbinical School of Hebrew College. He is the author of “Radical Judaism: Rethinking God and Tradition” (Yale University Press).