A general trend in 5E monster design (probably applies to 3E and 4E as well) is the reduction of asymmetric monsters. Monsters with immunities, or special attacks or special requirements existed to provide an alternative approach. Some monsters can't be assaulted directly and need to be handled a different way. These 'puzzle' monsters exist to force players to look at other tactics.
I like combat to be tense, exciting and allow all the players to meaningfully contribute.
Binary, all-or-nothing powers make this less likely. That's been my experience, not just across multiple editions of D&D, but in other rpgs as well. A common situation in D&D is a monster that is very hard to defeat but becomes uninteresting if the PCs have access to a particular spell or item such as
Protection from Evil or magic weapons.
Take a monster that is immune to non-magic weapons. If all the martial PCs have magic weapons, which is often the case in mid to high level play, then the immunity is irrelevant. If some martial PCs lack such weapons then they don't get to contribute.
Here's a few examples from actual play:
1) In a 3e game we were preparing to attack a nest of vampire spawn. We would have been very vulnerable to their Domination power but we cast
Protection From Evil on every party member rendering us immune. This turned an impossible or very hard encounter into a relatively easy and imo not very interesting one.
2) Again in 3e, the party were surprised by an umber hulk. Its confusion ability caused, not merely a TPK, but a boring TPK with most of the players unable to control their own characters. If the PCs had cast
Protection from Evil otoh as in the example above the encounter would have been trivial.
3) In an 8th level 2e game a multiclass magic-user/cleric was the only PC in the party who could fight a ghost, using defensive spells to make himself immune to its attacks. The other players had nothing to do while he solo-ed it.
4) In a 5e game we fought a dragon construct in its lair. It had no relevant immunities and was defeated by having its hit points reduced to zero. The fight was a very close run thing, and extremely memorable, involving many interesting tactical choices. It wasn't determined by a single spell or ability and every PC made a significant contribution. Even the bard.