Android applications automatically turning on when wifi is toggled on
It seems like you're making this problem for yourself.

As designed, apps can ask Android to notify them when a network connection appears or disappears. Some apps might want to be notified when they're running in the foreground, but some apps might need to be notified whether they were already running or not. This is necessary for the correct functioning of the app.

It wouldn't normally cause any lag, because background services always run at a lower priority than the foreground app. When an app finishes running normally, Android caches it in RAM, so that next time it starts (whether it's a foreground activity or a background service), it can start immediately, using less battery. But if you routinely force-stop apps, or use a "task killer" or the "Background process limit" option in the developer settings to stop them, then next time the same app starts, Android has to spend time and energy loading it from storage again, causing lag.

So my recommendation for how to stop your phone lagging when you connect to Wi-Fi is that you should let Android do its own job of managing processes, and stop trying to micromanage it. Leave that force-stop button for cases where a buggy app has gone out of control.

For more information on why task killers slow your phone down, see the answers to How can I stop applications and services from running?