The Maagid teaches an important principle – everything that comes into our field, be it thought, vision, hearing etc. all was designed.
The purpose of this design is inevitably one of two things:
Either it serves as lessons in life – as the Baal Shem Tov teaches, that everything contains an immortal lesson (on how to grow.)
The second is that it is negative, however the negative mirrors a positive.
In other words, as there is love of G-d there is lust – as there is fear of G-d, there is fear.
Now this would be similar to a person who is sent a message from the king – if the message is a bad one, and the messenger comes dressed in scary clothing (think police) a person might become very fearful, but this person is a fool, for instead of fearing the messenger, he should go deal with the king.
Similarly, if the messenger is a minister, and has a joyous message, the person might become very happy sitting with the messenger and rejoicing; while in actual fact, the king desires for him to rejoice with the king.