The only way this law would be enforced is if the police had a reason to check the inside of a house while the parents were gone.
The only way that would happen is if the neighbors call them in. That could be encouraged by loud noises, a fire, too many strangers being invited in, odd shadows in the window, odd sounds, or etc.
Well, I suppose there is the way if the parent told a co-worker and the co-worker either hated them or was overly-concerned --- that would also lead to them calling the police on that.
In reality, this law isn't a problem unless a different problem occurs.
No police go to each house just to check if there's children unattended there or not.
I encourage this law, as it has more uses and pros than it does misuses and cons.