@Greatest I am,
That is a very interesting question you posted. Let's see what the Bible says:
God did not create the Devil. Read James 1:13, 14 in your personal copy of the Bible. It tells us that God is not capable of evil things. So God created an angel who later BECAME the Devil, also known as Satan. Jesus implied that at one time the Devil had been truthful and guiltless. Originally, then, the Devil was a righteous angelic son of God. The angel who became the Devil chose to oppose God and incited the first human pair to join him. He thus made himself Satan, which means “Resister.”—Read Genesis 3:1-5; Revelation 12:9.
Like the rest of God’s intelligent creatures, the angel that became the Devil had the FREEDOM to choose between doing right and doing wrong, but he developed a desire to be worshipped. His desire for glory was stronger than his desire to please God.
Please read Genesis 3:6. Here we learn that Eve CHOSE to disobey God and eat fruit from the tree that God had instructed them NOT to eat from, just like a young child, for example, may choose to disobey their parents and watch a very scary movie. The parents did their job and taught their child why they shouldn't watch the scary movie, but the child still CHOSE to do it anyway. It was the same with Adam and Eve, and the angel that later became Satan the Devil.
Please read Isaiah 48:17, 18. Here we learn that God teaches us right from wrong, but a person will only find peace if they choose to obey, just like a young child will not have nightmares is he or she chooses not to watch the scary movie.
You had a very thought-provoking Bible question. For answers to any other Bible questions, go to JW.org and type your question into the search field.
Good day to you.