He was good for Judaism. He was bad for the Jews.

Rabbi Ovadia Yosef was one of the most complex figures of modern history. He was a towering presence and a gutter hooligan. He was a religious authority of Talmudic proportions and a dirty politician of Nixonian dimensions. An eloquent writer and a hateful, abusive speaker.

No wonder journalists had trouble crafting his obituary. Those who didn’t struggle inevitably missed the complexities, composing either sizzling diatribes or fawning elegies. Neither does him justice.

I’ll call him Rav Ovadia. That’s how he was known in Israel.

Iraq-born Rav Ovadia showed his genius as a teenager, insisting on Sephardic interpretations of halacha (Jewish religious law) at a time when the Sephardic take was looked down on and dismissed.

As the decades passed, he wrote dozens of books, analyzing, interpreting and ruling on Jewish matters in a uniquely tolerant style, staying within the strict boundaries of Orthodox Judaism but finding mechanisms to make it all fit into the lenient religious life style of many Sephardic Jews here.

His landmark rulings were many. He found a halachic way to free the widows of soldiers killed in the 1973 war, but whose bodies were not recovered, to remarry. He declared Ethiopian Jews to be halachically Jewish. He permitted trading land for peace, though he backtracked on that one in later years.

It started going wrong when he allowed his followers to elevate him to a demi-god and to try to prove that their interpretations were right and the Ashkenazi interpretations were wrong — instead of equally valid.

There are absurd estimates that 850,000 people thronged Jerusalem for his funeral. Even if it was a quarter of that, it was an outpouring of grief —over the top, in fact, bordering on idolatry. A week after his death, his pictures are everywhere, even more than before.

One of his daughters-in-law said his line would bring the Messiah, “Mashiach ben Yosef,” though tradition holds that the Messiah will come from the family of King David — not Rav Ovadia.

By the 1990s, if you asked a Sephardic rabbi about a particular practice, the answer would often be framed like this: “The Ashkenazim do such-and-such, but WE…”

It has progressed to the extent that while Ashkenazim, the Jews from Europe, mistreated and discriminated against the Sephardim during  the first decades of Israel’s existence, and many still do — too many Sephardic Jews have become Israel’s new racists.

I’ll never forget seeing an elderly Sephardic Jew standing at the side of the road asking for a ride, but I couldn’t stop there because of traffic. By the time I could pull off the road to pick him up, he had enough time to yell, “Go back to Auschwitz!”

Discussions with Sephardic Jews on religious topics too often deteriorate into disparagement of Ashkenazi practices and Ashkenazim themselves. Some Sephardic Jews even believe they cannot fulfill their prayer obligations in an Ashkenazi synagogue. I have never encountered an Ashkenazi Jew with such an outrageous, racist viewpoint, though many on both sides irrationally condemn liberal streams of Judaism.

It’s important to note that many, probably most, Sephardim do not fit this pattern, but the increased ethnic conflict is the fault of Rav Ovadia.

By 1983, when he set up the Sephardic Shas Party to represent his half of the population and exploit its numbers, Israel was actually going in the direction of overcoming its decades of discrimination.

In 1983, Israel’s president was Yitzhak Navon, a proud representative of 300 years of his family’s Sephardic tradition in Jerusalem.

The Israeli Defense Forces chief of staff was Lt. Gen. Moshe Levy, born in Tel Aviv to parents from Iraq.

Of the 26 ministers in Prime Minister Menahem Begin’s Cabinet, at least four were from the Sephardic community. There was still a long way to go, but there was hope for a quiet solution then.

Before Shas, President Navon himself told me he didn’t think the “ethnic problem,” as it was known, would last much longer.

“We will marry it away,” he said in his colorful, quiet style, meaning that the younger generations of Sephardic and Ashkenazi Jews didn’t really care about their origins — they were all Israelis. And in fact, all four of our children, now in their 30s and as Ashkenazi as the day is long, are married to Sephardic spouses, and no one cares.

Rav Ovadia stopped the positive process and reversed it for political gains.

The premise of Shas was, is, that Sephardim are systematically and purposely downtrodden by the evil Ashkenazim. Therefore the Sephardim must rise up and claim what is theirs. They must have their own separate institutions, which the government must fund. Their leaders must pander to the basest beliefs and instincts of their community, dividing them from the rest of Israel, perpetuating superstition, attributing mystical powers to their rabbis and emphasizing innumerable perceptions of slights and discrimination.

When many leading members of the Shas parliamentary delegation were either on trial or already in prison for bribery and fraud, they allowed only two explanations: “The Ashkenazim are out to get us,” or “They’ve been doing this for years and now it’s our turn.”

One of the most brilliant rabbis in Jewish history laced his public pronouncements with filth like pledging to dance on the grave of one of his critics, condemning gays, liberal Jews and non-Jews, saying Israeli soldiers were killed in battle because they were not religious enough, natural disasters were the result of not enough Torah study. He even blamed the Jewish victims for causing the Holocaust: “Because of their many sins, God’s fury was brought down upon them.”

That’s just a sample of his outrageous utterings.

It is hard to imagine that he did not know what he was doing — enflaming hatred and tensions between ethnic groups. If he did know what he was doing, then he stands out not only as one of the great rabbinical scholars of all time, but also as one of the most cynical and destructive politicians the Jewish people have ever suffered.

There is no question that with his moderate rulings, he was good for Judaism. But instead of a healer and a unifier, he chose to be a poisoner and a divider.

What a tragedy that he was bad for the Jews.