IN my opinion, Satan is a tool of God, a teaching tool.
If God wanted robots, he would have made robots.
If God just immediately answered all your prayers and you never have to work or learn, how could you grow into an angel??
In the Bible it says that God knew the end from the begining.
The God vs. Satan story seems very analogous to the Judas against Jesus story. "One of you will betray me"
I think it is that it is the nature of a creature to want to try to overtake its creator. This might even come about by a faulty kind of love, where a creature loves its creator so much, he/she wants to BE the creator. This can never be so.
So I think God is teaching us in a very grand way how that can never be and that to think or try something like that is disasterous.
I also have soemtimes thought that good and evil energies might have been necessary in the creation of eternity for us - maybe a kind of scaffolding and maybe that is what dark matter is.
It even makes sense in a quantum physical kind of way.
Jesus by taking on a world of suffering created a kind of pathway up through the universe into the heavenly realm. "NO one come to the Father but through me"
Finally, I think most of the times in the Bible where it says God gave someone over to sin is when that person was already hard-hearted and perhaps against God.
Of course, I could be wrong about anything.
Why doesn't god answer prayers to stop you from sinning or to lose a sinful passion even though he hates sin? Supposedly God hates the sin and not the sinner so why give people sins they never wanted to have? I feel more than just a sneaking suspicion that he wants us to suffer with things we can't help and feel guilty about them for what? I don't know. I wonder, there are numerous indications in the bible that God hardens hearts and makes people worse than they already are in response to things that those individuals didnt' do even.