Prevent any Android app from changing WiFi state
You can use Android's native permission manager (appops) to debar apps from using that permission. While you can use appops command using adb, it can become a pain because you need a PC to get that job done, unless you have root access. As an alternative, there are third-party GUI frontends for appops in Play Store, of which, I use App Ops - Permission Manager. It can work with both rooted and non-rooted  phone, although, it would still be relatively painful in non-rooted mode.

The app shows tutorial at initial startup, to setup the mode to grant it the requisite privilege. After that, you just find your app in the list, and toggle that permission listed with the title "Connect and Disconnect from Wi-Fi".

Under App Ops app's settings, you can setup a template (allowing or debarring a permission) which would apply on all the newly installed apps.