When Donald Trump’s candidacy sent TV ratings soaring last year, CBS honcho Les Moonves infamously summed up his reaction: “It may not be good for America, but it’s damn good for CBS.”

The same emphasis on corporate profits is surely the driving force behind the decision to pull Scott Pelley from the “CBS Evening News” anchor chair. (Moonves later sought to clarify that he was speaking about ad dollars, not ratings; but both involve the bottom line.)

Pelley’s tenure has been marked by his intelligent, truth-seeking approach to the news, pulling no punches while still remaining impartial.

In recent months, his pointed assessments have drawn attention, as when, for example, he said in February: “It has been a busy day for presidential statements divorced from reality,” and went on to detail President Trump’s fictions du jour.

He did plenty of on-air fact-checking, too, as when — referring to Trump’s claim that millions of people voted illegally, giving Hillary Clinton her popular vote victory, he noted: “There is not one state election official, Democrat or Republican, who supports that claim.”

And he once memorably described the truth-averse Trump aide Kellyanne Conway as “a fearless fabulist.”

From a purely journalistic perspective, Pelley was both refreshing and impressive. And his journalistic credentials certainly outpaced those of his rivals at NBC (Lester Holt) and ABC (David Muir).

“The book on Scott for a long time is that he’s a great reporter but not a natural anchor,” said Tom Bettag, a veteran TV news executive who has worked for four networks, including CBS. Bettag told me that the journalistic quality of the half-hour show has vastly improved under Pelley’s leadership.

But the ratings remained relatively anemic — an average of 7 million viewers on a typical weeknight — and showed little sign of significant movement.

So now, the veteran newsman, who took over for Katie Couric in 2011, returns to the network’s flagship Sunday night news show, “60 Minutes,” where he has done award-winning work for years. (As a longtime reporter, Pelley broke major stories in the Bill Clinton-Monica Lewinsky scandal, and reported from war zones.)

The evening news shows still matter a great deal, though certainly not as much as they did decades ago in the Walter Cronkite and Huntley-Brinkley era.

The three together pull in 23 million viewers on a typical weeknight — far more than their cable brethren. And their viewership (as evidenced by the ads for erectile-dysfunction remedies) is older — which makes them less coveted by advertisers but also more likely to be active voters.

Despite all the attention to Bill O’Reilly’s demise from Fox News, the Pelley move probably matters more in terms of influencing the electorate.

That’s what makes it hard to take. While there’s no indication that it was Pelley’s forthrightness that got him canned, there’s also no sense that his journalistic chops mattered very much to the powers that be.

And the way it was done — without a successor groomed and waiting in the wings, and without a graceful exit for Pelley — is less than classy. (Anthony Mason will be the interim anchor while CBS ponders its next move.)

There are right and wrong ways to make these transitions. This was the wrong way, and for the wrong reasons.

For more by Margaret Sullivan visit wapo.st/sullivan.