Since the release of Mavericks in October 2013, there has been a widespread problem with Macs that are unable to reconnect to a wireless network after waking from sleep. This is most prevelant on MacBooks because they are on battery power most of the time and are set to sleep after two minutes of inactivity by default. MacBooks are also mobile and can be used in many locations.
The problem is caused by an interaction with Bluetooth and specifically Bluetooth devices that use Advanced Audio Distribution Profile (A2DP) which is used to stream bluetooth audio from devices such as Bluetooth headsets and Bluetooth speakers.
For more information and a fix...