Its box office is too high to explain with just one factor. If it as just one thing, then there would be many other movies higher on the list.
There are other less successful movies that have suffered behind the scenes tragedies, like Ledger's death. There are other less successful movies that were, frankly, a bit better. There are other movies that have had an equally enthusiastic core group of "fan boys" that didn't make even a fraction as much money. There are other movies that have had bigger budgets and more hype that made less money.
The fact is that its not any one of those things, its a combination of them all working together. It happens to be a very good movie (but certainly not the best ever), and the death of Heath Ledger undoubtedly brought in a lot of people who wouldn't normally see a comic book movie, and it was always going to be a reasonably successful blockbuster even if neither of those other things were true. The combination of those things pushed it over the top into a huge success.
There are other less successful movies that have suffered behind the scenes tragedies, like Ledger's death. There are other less successful movies that were, frankly, a bit better. There are other movies that have had an equally enthusiastic core group of "fan boys" that didn't make even a fraction as much money. There are other movies that have had bigger budgets and more hype that made less money.
The fact is that its not any one of those things, its a combination of them all working together. It happens to be a very good movie (but certainly not the best ever), and the death of Heath Ledger undoubtedly brought in a lot of people who wouldn't normally see a comic book movie, and it was always going to be a reasonably successful blockbuster even if neither of those other things were true. The combination of those things pushed it over the top into a huge success.