I think it's a bug with the latest update. Quite a few people have had the same problem on the S7, S7 Edge and Note 5 since the latest upgrade they received.
If you go to your Location Settings, Improve Accuracy and then turn off WI-FI SCANNING, that should do the trick. Hopefully this bug will get squashed in the next update (which I'm guessing will be early December with the security patch).
I was having the same problem this week with my Samsung Note 4. Wifi kept turning on and off. Very annoying. I tried all the recommended troubleshooting steps from 2014 and 2015. I tried restarting the internet modem and the router. I tried restarting the phone. I tried restarting the phone in safe mode. I tried turning off Mobile Data. I tried turning on mobile data and turning off Smart Switch. Finally, I tried putting the phone in Airplane Mode and then turning the wifi on. Everything is back to normal now.