(Bloomberg Opinion) -- Corporations are easy to hate. They are big, they are impersonal, and they operate by profit-driven rules that can sometimes seem cruel. When corporations are accused of wrongdoing by a community led by a plucky plaintiffs lawyer, there is a natural tendency to believe the latter over the former.

Chevron Corp., which is ranked 13th on the Fortune 500 and had $128 billion in 2017 revenue, has the added burden of being an oil company. There are those, like the influential environmental activist Bill McKibben, who believe that what oil companies do is inherently evil: Extracting fossil fuel from the ground is an activity that can only accelerate climate change. But even those on the left who are not as hard-line as McKibben tend to view oil companies more as entities that cause oil spills and fund right-wing think tanks than as the producers of the fuel that keeps the world economy churning.

Thus when the American lawyer Steven Donziger embarked on what became a 25-year crusade to force Chevron to pay billions to clean up a contaminated swath of the Ecuadorian rain forest, he was lionized by environmentalists and the news media. The contamination, local farmers and indigenous tribesmen said, had been caused by Texaco, which had drilled in the region in the 1990s; Chevron had assumed its legal liabilities when it bought Texaco in 2001.

Never mind that Texaco had paid for a $40 million cleanup years earlier, or that it had a signed agreement with the Ecuadorian government absolving it of further liability. The cleanup had to be insufficient; the agreement had to be corrupt. The indigenous people called themselves “Los Afectados” — the Affected Ones. What more did you need to know?

Vanity Fair weighed in with a glowing article in 2007 about the work Donziger and his allies were doing to force Chevron to “answer for the conditions … said by environmentalists to be one of the world's most contaminated industrial sites.” There were the usual David-vs.-Goliath articles in publications like Mother Jones and the Nation. In 2013, at a time when Donziger was being accused of wrongdoing, the New York Times conducted several sympathetic interviews, and described him as a “hero to many environmentalists.”

What prompts this recollection is the news this week that a New York appeals court suspended Donziger’s law license “until further notice.” It is almost surely the end of the road for Donziger’s quest to wrest money from Chevron. But it also offers proof that you shouldn’t necessarily assume that corporations are the bad guys.  Sometimes the big bad corporation is in the right, and the plucky plaintiffs lawyer is in the wrong.

As you may recall, in 2011, after years of legal wrangling, an Ecuadorian judge ordered Chevron to pay the plaintiffs $18 billion. Although the amount was cut to $9.5 billion on appeal, that was still an extraordinary amount. Because Chevron had no assets in Ecuador, the only way the Donziger could get the money was to sue for it in other jurisdictions, starting with the U.S.

Chevron, meanwhile, decided to fight back with everything it had. It forced the release of outtakes of a documentary that showed an expert telling Donziger that the contamination was not as severe as he claimed, and it had him cynically suggesting that the Ecuadorian courts could be manipulated. (“We believe they make decisions based on who they fear the most, not what the law should dictate,” Donziger said in the film.)

That led to further revelations, and the filing of a racketeering suit by Chevron against Donziger. After a lengthy trial, District Judge Lewis Kaplan issued a devastating 485 page decision in 2014.

In a later decision summarizing his conclusion about Donziger’s behavior, Kaplan wrote that Donziger had won the case in Ecuador by:

Foisting fraudulent evidence on an Ecuadorian court, coercing Ecuadorian judges, illegally writing all or much of the Ecuadorian court’s purported decision, and then procuring the signature of an Ecuadorian judge on a $19 billion judgment against Chevron that the co-conspirators had written, in part by the promise of a $500,000 bribe.

In an email he once wrote to me, Donziger complained that he was “the target of what is probably the most well-funded corporate retaliation campaign in U.S. history.” And you know what? He’s probably right. Chevron employed an army of lawyers from the pricey firm of Gibson, Dunn & Crutcher. It sent private investigators to Ecuador. It forced Donziger’s experts to retract their own report. And the law firm of Squire Patton Boggs actually apologized to Chevron, and paid it $15 million, for its role in defending Donziger.

But Donziger has no one to blame but himself. I don’t doubt that Donziger had honorable motives when he began the case. But as he realized that Chevron was not going to fold — and, perhaps, that his case was not as big or as airtight as he had originally thought — he lost his ethical compass. Chevron nailed him for it.

“Even if Donziger and his clients had a just cause,” Kaplan said back in 2014, “they were not entitled to corrupt the process to achieve their goal.”

Needless to say, Kaplan’s ruling has meant Chevron will never have to use its U.S. assets to pay the $9.5 billion verdict, which was reaffirmed by Ecuador's highest court Wednesday. Last November, an appeals court in Brazil said that Chevron was not liable for the contamination, and that its Brazilian assets could not be used to pay the judgment. The same thing happened two months ago in Canada. And so it goes.

Although Donziger vows to press on, the suspension of his law license could well be the end of this saga. After 25 years, the only moral of this story is that whether or not corporations are  evil, if you are going to take them on, you’d better have the goods. And you’d better play by the rules.

To contact the author of this story: Joe Nocera at jnocera3@bloomberg.net

To contact the editor responsible for this story: Stacey Shick at sshick@bloomberg.net

©2018 Bloomberg L.P.