Because the game already also runs on Xbox and, given MS's recent gaming strategy (which is putting less emphasis on Xbox exclusives), could conceivably come to Playstation or maybe even Switch 2 in the future.
On the Windows side of things, there's also a push towards ARM hardware (with current Snapdragon-based hardware actually performing pretty well). Not sure if Flight Simulator is currently ARM-native, but having the ability to go ARM-native is probably desirable at least as a long-term goal.
Security is the big one. C++ DLLs have relatively free reign and are difficult to sandbox. With WASM you have a much stricter security model where the host program has full control over what APIs it has access to.
The addons are developed by third parties that aren't Microsoft, so there's a serious risk of malware and other ways of getting the user pwned.
The added future-proofing/portability is a nice bonus, but I suspect maybe not the main motivator.
Particularly for something designed to run on consoles sandboxing of addons is basically a requirement. Microsoft are never going to allow random people on the internet to run unsandboxed code on the Xbox because that's a fast route to people jailbreaking the DRM on them. I suspect the fact this also limits the use of Flight Sim mods as a vector for malware on Windows is just a happy side effect.
There were already parts in MSFS 2020, namely gauges aka everything in cockpit that had more dynamic display, that used JS based SDK in order to provide sandboxing and safe level of control over performance (because with sandboxes VM it's easier to preempt execution)
WASM provides a secure sandbox with predictable performance across platforms while giving Microsoft the ability to maintain compatibility if they port to Xbox, cloud, or other platforms without requiring developers to recompile their add-ons.
In addition to the sibling comments, you can sandbox WASM's CPU time. You can say after a certain amount of time that it has to yield back to the host. With native plugins, you might never get your OS thread back, and there isn't a good way to safely abort it and free memory and everything
Is it for future proofing it in case MS wants to release the game in a different platform that is not windows ?