“I’VE never known it to be an embarrassment for a business leader to be associated with an American president,” declares Max Bazerman of Harvard Business School. Donald Trump, in particular, has positioned himself as a businessman-president, whose corporate acumen would unleash a new era for American business. Investors seemed to believe him—his election prompted a giddy “Trump bump” in the stockmarket—and corporate bosses flocked to his side. This week they fled. For many, it seems as much a clear-eyed business calculation as a moral awakening.

Some distanced themselves more quickly than others. The trigger was Mr Trump’s reluctance to condemn neo-Nazis and white supremacists who staged violent protests in Virginia on August 12th. Kenneth Frazier (pictured), chief executive of Merck, a big pharmaceutical firm, was the first to leave Mr Trump’s advisory council on manufacturing. On August 14th Mr Trump denounced racist groups in a scripted statement. But the bosses of Under Armour, a sporting-goods outfit, and Intel, a computer-chip giant, defected, too.

On August 15th Mr Trump appeared once again to equate white supremacists with demonstrators opposing them. As word leaked the next day that chief executives might resign en masse, Mr Trump swiftly tweeted that he was disbanding his manufacturing council and his strategic and policy forum, another advisory group.

The calculus of aligning with Mr Trump at first seemed straightforward. By serving on the president’s councils, bosses hoped to nudge him to deliver reform. Banks remain eager to roll back financial regulations. Manufacturing and construction firms hope to benefit from support for domestic production and a binge in infrastructure spending. All companies want a lower corporate-tax rate.

More than two dozen chief executives, led by Andrew Liveris of Dow, a chemicals colossus, joined Mr Trump’s manufacturing advisory council. About a score joined the strategic and policy forum, led by Stephen Schwarzman of Blackstone, a private-equity firm. Mr Trump seemed to take particular pleasure in summoning corporate titans; executives smiled as he spoke of his bold plans, even as some acknowledged his shortcomings in private.

Technology firms were early to distance themselves from the president: Google and Apple, for instance, have supported a suit challenging Mr Trump’s policy for immigrants from Muslim countries. But many bosses stayed on the councils, even in the immediate aftermath of the Charlottesville crisis. Those included JPMorgan Chase’s Jamie Dimon, Mary Barra of General Motors and Ginni Rometty of IBM.

No longer. Even setting aside matters of personal conscience, the costs and benefits for bosses of sitting alongside the president have changed. Serving on Mr Trump’s councils yielded few obvious benefits. The forums are mostly ceremonial. Mr Trump has so far proved unable to advance any major policy, including a business-friendly rollback of Democrats’ health law. Tax reform is complex even in favourable political climates; it does not help that Mr Trump has taken to lambasting Mitch McConnell, the Republican Senate majority leader and a supposed ally. Democrats may not back Mr Trump even on infrastructure spending, which they support.

Continuing to serve on the councils increasingly seemed to serve little purpose other than to anger consumers and staff. In the wake of the president’s comments, companies that did not quit at once (among them PepsiCo, which sells fizzy drinks and snacks) faced campaigns threatening boycotts. IBM must compete with Silicon Valley for talent; staff had criticised Ms Rometty’s allegiance to Mr Trump.

Many executives will doubtless continue to court Mr Trump in private. Mr Schwarzman has known the president for years, for example. His new infrastructure fund, which in May received a $20bn investment from Saudi Arabia, has much to gain from any new spending on bridges and roads. Others will decide they are better off keeping their distance. Recent jumps in share prices have been largely attributable to firms’ own performance, despite Mr Trump’s tweets claiming credit.