This only holds true in higher age demographics, and is often because people who are very sick (with, say, cancer or copd) are often cachectic.
As has been proven again and again and again (and again with a recent large study), being obese is almost never associated with better outcomes.
Since there is much confusion here about BMI and its validity, maybe this study from 2012 can help:
They compared BMI measurements with body fat percentage (the latter one being a more rigorous procedure to determine if someone is obese or not). As summed up in table 2, amongst their participants
39% of subjects were deemed non-obese by BMI, while they are in fact obese according to body fat percentage (splits into 48% women, 22% men)
and only 1% of subjects were deemed obese by BMI, while they are non-obese according to body fat percentage (3% men and 0% women)
^(Note that the study included more women than men, which is why the percentages average up a bit weirdly)
In other words, given two people with the same BMI, the one with higher body fat (and thus lower muscle mass) has a higher risk of death? Makes sense. BMI is a limited measure and body fat percentage is much more accurate.