allow it to be disabled when connected to WiFi networks the user sets eg home WiFi.
Nice idea. But in addition to the spoofing issue, I'd guess a more UI-based reason, too:
When waking, it can take several seconds to connect to WiFi; sometimes longer.
If the lock screen appeared during this time, it would always appear — and then vanish a few second later. If you were in the middle of typing a password, some of those keystrokes could get applied to whichever app was revealed. — On the other hand, if the lock screen did
not appear until it had scanned all the local networks and failed to connect to a suitable one, then you could see and interact with apps until that point, which would be a security risk (and very annoying if the lock screen suddenly appeared in the middle of tapping or typing).
So I don't think it
could work as we'd want.
someone would need to know what SSIDs and/or MAC address disable the screen lock
True, but there may be scenarios where those are known. (For example, a disgruntled ex-employee.) Even if not, how long would it take to cycle a spoofer through all the short SSIDs?