There is no rule for immunity, but it is not needed
There are no creatures described in the official books which are explicitly immune to this particular action from this particular stats block. That does not mean there are no such creatures in your game world tho. Quite the contrary, the Monster Manual suggests the DM not to be restricted by it:
Naturally, you can do with these monsters what you will. Nothing we say here is intended to curtail your creativity.
So, as a DM, if you think populating your game world with omni-draining shadows are absurd, don't do that. The book also specifies, what are these descriptions for:
You might read a monster's entry and be spurred to create an adventure revolving around it, or you might have an awesome idea for a dungeon and need just the right monsters to populate it. That's where the Monster Manual comes in handy.
In other words, Monster Manual descriptions are intended to be used for making exciting encounters for the party or generating ideas for a story. They are not intended to be used as a restrictions for the wordbuilding process, serving as kind of fundamental "laws of the nature". A strength-draining Shadow is a decent challenge for the party, and it should stay this way.
This also probably happens off-screen
If something happens off-screen in your games, as a DM, you are not supposed to use standard combat rules for resolving the outcome. If 100 townspeople killed a dragon somewhere, you are free to describe this as plausible as you think it should be. Don't run a combat encounter with 101 participants, especially in the middle of your game, making the players to wait meaninglessly.
The standard combat rules are intended to be used for simulating small-scale encounters. Use proper mechanics for resolution or don't use any if there is no need. There are mass combat rules (UA only, for now) for big armies, but they are excessive for resolving something that already happened sometime, somewhere.
DMG chapter 8 "Running the game" describes rules as a DM's tool:
Rules enable you and your players to have fun at the table. The rules serve you, not vice versa.
If something (like following a literal reading of a rule) makes your world look stupid or absurd and therefore spoils the fun, don't do that. That's how the rules are supposed to be used according to the rules themselves.