I've had the same issue with my Moto X Pure 2014 with 4.4, 5.0 and 5.1. Woke up this morning to no saved networks.
Phone was plugged in overnight and at 95% so I suspect a remote conjecture is that it happens when the phone shuts down from a dead battery. Maybe I jostled the cable in my...