They didn't TRY to have a bad team for 50 years. And not all their teams were bad. Their biggest impediment to success was always with ownership putting short term profit ahead of on ice success and the front office being incompetent and hiring incompetent coaches and scouts.
I don't care what else a franchise is doing well. If ownership and management only know the cost of everything and the value of nothing that franchise is doomed. Back when Quinn was around the Leafs had a chance to get Gretzky and when it was brought to the Board their only comment was "Meh. How many more tickets would he really sell?" When money matters more than winning Cups you make money and you don't win Cups.
It's no secret why the Habs and Leafs don't win championships anymore. It's because they aren't really trying that hard to win them anymore. The Leafs began not caring a couple of decades earlier than the Habs but the two franchises are today basically the same in the way they approach the business. They like making money and they've both found ways to do that which are not dependent upon how well the team on the ice does. So the on ice product, instead of driving revenue, just becomes a cost of doing business. And like any business these days, companies try to minimize costs to maximize profits.
The teams that win Cups nowadays are the ones who need to win in order to make money, stay relevant, and add to their franchise value. The Habs and Leafs make money hand over fist and the value of their franchises goes only in one direction. And that happens whether they go to the finals or miss the playoffs. They are licenses to print money simply because they exist. They don't have to actually do anything. That's great news if you're a shareholder but not so great news if you're just a fan.