"Allaah is the Creator of all things, and He is, over all things, Disposer of affairs." (Sooratuz-Zumar, 39:62)
Allaah's سبحانه و تعالى creation is all good, and is of great underlying wisdom and benefit. However, the goodness and wisdom behind what appears to be evil may not be perceived by many people.
Whereas texts of the Qur'aan and Sunnah attribute good and honourable actions directly to Allaah سبحانه و تعالى, they often do not directly attribute to Him actions or things that are apparently evil. This is done out of respect and reverence for Him. The same rule applies to dreams: attributing good dreams directly to Allaah سبحانه و تعالى is a common practise in the Sunnah, whereas bad dreams are attributed to Shaytaan - though he does not create them.
[The Dreamers Handbook]