Whatever caused it, the hard reset was the right thing to do. If there's been a lot of activity, such as installing or deleting apps, a hard reset gives the device a chance to organize all the changes.
Also, if there are multiple wireless networks available, make sure it's connected to the right one. It may be attempting to connect to another wireless network but doesn't have the password.