Smart people do dumb things. The reason is that, as Daniel Kahneman wrote in Thinking Fast and Slow, people are systematically irrational. For example, they are subject to confirmation bias -- the tendency of decision-makers to ignore information that contradicts a conclusion they have already reached.

I would argue that the CEO and board of Twitter fell victim to their own confirmation bias when they signed an April 25 merger contract for Elon Musk to pay $54.20 a share -- or $44 billion -- for all of Twitter's shares. That price represented a 38 percent premium over Twitter's value the month before, according to the New York Times.

What does this have to do with confirmation bias? Twitter's CEO and its board decided that $54.20 a share was a high value for the company -- probably higher than any other bidder would pay and more than the company would be worth after executing its strategic plan as an independent company.

Given the high price, Twitter chose to ignore what in retrospect looks to be an obvious reason not to sign a contract with Elon Musk -- in prior deals, he has made material misstatements.

While Musk's regulatory filing alleged that Twitter did not give him the information he needed to assess the number of fake accounts on the service, Musk's real reason for reneging on the deal may be that the digital advertising market on which Twitter depends has cratered, as has the value of the currency Musk intended to use to pay for Twitter -- Tesla's stock.

Twitter argues that Musk must go forward with the $44 billion deal he signed in April to buy the company.

In short, Twitter -- whose shares on July 11 had lost 35 percent of their value since peaking when the deal was signed -- is in for a world of hurt. That's because Musk seems happy to pay the legal fees required to get out of the deal cheaply and Twitter lacks a good way to boost the company's value or to attract another bidder.

Business leaders can avoid such nasty traps by doing three things.

1. Know your negotiating partner.

Before you sign a merger contract, conduct due diligence. That means doing independent investigation by interviewing customers, employees, suppliers, and investors who have worked with the partner.

I am guessing that Twitter was well aware of Musk's reputation for less-than-forthright conduct. Most egregiously, in 2018, Musk tweeted that he had "funding secured" to take Tesla private for $420 a share.

That statement was false. According to the Wall Street Journal, "The SEC fined Mr. Musk for what it deemed a false statement. Mr. Musk also relinquished his role as Tesla chairman as part of the settlement. Mr. Musk is suing to have the settlement thrown out."

I would be shocked if Twitter's board was not aware of this. Based on Musk's past behavior, it should not have come as a huge surprise to Twitter that on June 8, Musk announced his intent to back out of his deal to acquire Twitter.

My guess is that Musk's agreement to pay such a high price for Twitter caused Twitter's board to ignore what it knew about Musk's prior track record or to assume that he would follow through with the contract despite that record.

2. Consider whether the deal will make customers, employees, and investors better off. 

Once your due diligence convinces you that the potential partner is honorable, you should assess whether the deal will make your customers, employees, and investors better off.

In my view, the only group that looked to benefit if Musk's Twitter deal went through was shareholders. I think the deal would have made employees and customers -- specifically advertisers -- considerably worse off.

How so? Based on his rough treatment of Tesla employees, what reason would Twitter employees have for being optimistic about their prospects under Musk's rule?

Moreover, Musk's apparent motivation for acquiring Twitter -- to bring Donald Trump and others of his ilk back to the site -- would make it more toxic for many advertisers and thus drive down Twitter's value.

If you want to avoid Twitter's current fate, don't sign a deal that makes employees and customers worse off.

3. Have a next-best alternative to the deal in case it falls apart.

Finally, deals do not always go through. Therefore, companies should have a back-up growth strategy they can deploy should the deal evaporate. If Twitter has such a strategy, now would be a good time to make it happen.

Do these three things and you can avoid Twitter's miserable fate.