As the other answers mention, Boeing management was complacent and were caught with their pants down by the Airbus 320 Neo. Upon its birth, Airbus industries took on a whole new, and radical, if I may say so, approach to airplane design. From the very beginning they produced a family of aircraft, where Boeing with its payload of history made more "unique" planes, in lack of a better word. Boeing planes are more like cousins to each other, not siblings.
This ideology of developing a plane family enabled Airbus to develop their concept very efficiently, and their progress came as somewhat of a surprise to Boeing. They were in trouble, as their R/D process is not as streamlined as its European counterparts. One of the major traps Boeing had already fallen into on its path quite some time ago, was that 737 was such a successful plane. They thought it would, and wanted it to, last forever. They thought the MAX upgrade was just another step to be taken to stay competitive, and they could fast track it if necessary. Needless to say, hindsight being 20/20, they were terribly wrong.
The reason 737 MAX failed big time was the fact that quite unfortunately, while Airbus 320 upgrades were building up unbearable pressure on them, a company culture formerly foreign to such a safety oriented industry as aircraft manufacturing was setting in at Boeing. Cutting corners, using sub-par outsourcing, hiding problems, misleading officials.... This is well documented on multiple sources. If one follows aviation news at all, it would have been impossible to miss.
Had Boeing stuck to high quality of design work, the end result would have been different. I mean, the 737 is an engineering marvel, there's no question about it. They just seriously effed it up on its last upgrade. There's a saying in the business world: Nothing can save a thriving business. Boeing was doing too well to see it's own faults.
So the factors leading to the catastrophic MAX project descicion were an unfortunate mix of falling off the R/D wagon a decade (or two) ago, underestimating the competition, and poor understanding of the industry by company management.