Amazon’s doomed search for HQ2, its second headquarters, came about because Jeff Bezos was envious of the large incentive Elon Musk was able to command from Nevada for Tesla’s giant battery factory, a new report says. There’s a lesson there for every leader: Be careful of letting emotions, especially negative emotions, drive your business decisions.

The search for HQ2 lasted more than a year and consumed untold hours of time from Amazon executives and government officials in 238 cities and counties. When it was over, the company had only half a deal, with Northern Virginia, which promised $573 million in incentives in return for for 25,000 of the planned 50,000 HQ2 Jobs. The other half of HQ2, planned for Queens, fell apart spectacularly when Amazon met with deep resistance and bad publicity over the $2.5 billion in incentives from the city and state, and the company’s unapologetic anti-union stance. 

Now, a new report by Bloomberg suggests that Jeff Bezos was driven by envy over a $1.3 billion incentive package the state of Nevada gave Tesla to build a gigafactory there. Bezos reportedly wondered why Amazon was getting much smaller subsidies. It was a theme he “returned to often” according to Bloomberg’s unnamed sources. Then in 2017, Amazon received a $40 million subsidy for building a new air hub near Cincinnati. The executive in charge of those negotiations considered it a win and sent out an email congratulating his team, but Bezos, annoyed by what he considered too small a sum, decided it was time for new tactics to bring in bigger incentives. He noted that Tesla had created competition among five Western states for its gigafactory, and the idea for the HQ2 contest was born.

“F–k you, we’re Amazon.”

Amazon drew up a request for proposals in which the word “incentive” is used 21 times. According to Bloomberg, some Amazon executives were uncomfortable with the language. They knew the company would be offered incentives but to demand them, especially given Bezos’s vast wealth, might expose Amazon to precisely the accusations of greed and arrogance that it later faced in Queens. But those who advocated a kinder, gentler approach were reportedly sent to work on other projects. According to news accounts, Bezos had set a $1 billion target in incentives for Amazon projects. (An Amazon spokesperson disputed this, Bloomberg says.) Internally, sources told Bloomberg, the negotiation strategy for HQ2 was informally referred to as “F–k you, we’re Amazon.” 

You know the rest. After what may be the most highly publicized location search of all time, Amazon selected not one but two HQ2 locations, Northern Virginia’s Crystal City, and the Long Island City neighborhood in Queens. New York offered subsidies that were twice as big as what Tesla got from Nevada. But when these details emerged, some of New York’s local leaders were incensed and protests sprang up. Governor Andrew Cuomo and New York City mayor Bill de Blasio hoped the company would stay the course, but instead, less than four months after announcing the contest’s two winners, Amazon pulled out of Queens.

There’s a pretty obvious lesson here: Business decisions should be based on the needs of your business and not envy of a different company in a completely different industry. It should have been apparent that a battery factory — which can go pretty much anywhere there is lots of space — is very different from an urban office complex to be staffed with tens of thousands of software engineers. Not many places can supply engineers by the tens of thousands, and those that can are not usually suffering for lack of good jobs. To me, the most surprising aspect of the episode is that Amazon got already-thriving New York City to cough up $2.5 billion.

The other lesson may be less obvious but it’s even more important. Jeff Bezos is, by a wide margin, the richest human on Earth. He built his mega-company from scratch to become the nation’s second-largest employer. If ever anyone was satisfied with their own accomplishments, you’d think it should be him. Instead, he apparently got so obsessed over what Elon Musk got that it clouded his usually impeccable judgment.

No matter who you are, or how successful you are, there will always be something you want that you don’t have. Sometimes that can drive healthy competitive zeal. Just don’t let it push you into doing something that’s all wrong for your company, or for you.

Amazon declined to comment for this piece.