Why do we dream? - Amy Adkins - YouTube
To increase the performance on some certain tasks, sleep is good, but dreaming while sleeping is better.
In 2010, researchers found that subjects where up to 10 times better in getting through a complex 3D maze if they napped and dreamed about the maze prior to their second attempt. Some memory processes can happen only while sleeping and the dreams are a signal that these processes take place.