This question has always seemed like a massive plot-hole to me. I find it interesting to discuss because it is such a massive plot-hole.
Did Jehovah not know what was in the heart of this creature? Does the story support that gap? Does god need this plot device so he adds it but refuses to take responsibility? Is Satan actually an equal god, but the book downplays his origin because that scares the shit out of them?
What’s the deal? Who created Satan, Why, and what did they know and when did they know it?
I might as well jump in here and add to the havoc
My answers to your questions in the last sentence:
1. God created Satan.
2. I don't know
why he created Satan. I am not capable of understanding the mind of God completely. You might as well ask me to explain quantum mechanics in understandable detailed terms. I can't do that either.
3. God always knew what would happen.
I did see that other posters mentioned the fact that Satan as we know him today is a relatively recent invention. They are right; the ancient Jews (who actually wrote the Bible) considered Satan to be more of a prosecutor or adversary than the completely evil creature portrayed in churches today. He filled the same role in Judaism as the djinn fill in Islam.
Ruth
You don't need to understand quantum mechanics to grasp that creating evil isn't compatible with being good.
The firefighter who is also an arsonist doesn't cancel out his evil deeds by his goodness in saving some of the lives he himself threatened.
When assessing an individual's character, a little bit of evil cancels a whole lot of good.
The answer to the question "Why did God create Satan?" may not be obvious in the details, but the broad strokes are enough to show that it was an evil thing to do - so the answer, whatever it might be, necessarily includes that God is an evildoer.
Which isn't a problem for me, as a disinterested observer of this fiction; But is a HUGE problem for fans who are determined to define God as the ultimate in goodness. It's logically impossible for the creator of Satan to be a purely good individual. Which isn't an issue if the entire question relates only too poorly written fiction, because fiction doesn't have to be consistent (although inconsistencies render it poor quality). But it's a huge problem for anyone who wants to claim this nonsense as a part of reality.
Reality is consistent. You don't need to understand quantum mechanics to grasp that 2+2=4 at all times and places. Or that a purely good individual cannot, by definition, create evil.
The obvious solution is to simply accept that God isn't good. His description in the OT in particular bears this out. He's no better morally than the least moral humans, and clearly far worse than most ordinary people. But of course that would imply that worship of this God character is unwarranted at best, and downright despicable in many ways.