I have read that before Christianity, Jews thought of the devil and his cohorts as tools used by God to test us and strengthen our faith. When Christianity was established the devil took on more of a role of opposite God, the supreme evil, anti-God. I am not trying to defend the devil in any way, but if you take into account that the devil has no authority and God is sovereign, then where do any of these evil spirits come from?
2 Chronicles 18:18-22 [ESV] - And Micaiah said, "Therefore hear the word of the LORD: I saw the LORD sitting on his throne, and all the host of heaven standing on his right hand and on his left. And the LORD said, 'Who will entice Ahab the king of Israel, that he may go up and fall at Ramoth-gilead?' And one said one thing, and another said another. Then a spirit came forward and stood before the LORD, saying, 'I will entice him.' And the LORD said to him, 'By what means?' And he said, 'I will go out, and will be a lying spirit in the mouth of all his prophets.' And he said, 'You are to entice him, and you shall succeed; go out and do so.' Now therefore behold, the LORD has put a lying spirit in the mouth of these your prophets. The LORD has declared disaster concerning you."
We see in this instance that God sends a lying spirit which many would consider evil. I believe that God does send evil spirits, and if he doesn't directly send them then he allows them to go. This was hard for me to accept at first, but then I remembered that I am being refined, and all the evil spirits I have overcome have made me 10x stronger than I was before.