Hockey is easily the best of the big sports. Its the fastest, most violent, most skilled. Games don't take forever. Its constant action. Its just marketed poorly.
Bettman took an "if you build it they will come approach" but expansion works better in markets that already like the product. He largely just ignored the product, other than in 2005. They've intentionally tried to suppress all of the interesting personalities (Hull, Roenick, Ovie, Kessel etc) and the skill of the game. They never really made an effort in gambling or esports until recently.
They tried to make hockey boring.
The NHL was always in tough because most sports play in the winter. MLB just relies on being the only thing on. But there is lots of competition for eyeballs, and they've never recognized that, or tried to compete for those eyeballs.