"The origin of sin is one of the
mysteries of the Bible. "The secret things belong to the Lord our
God." (Deuteronomy 29:29). Its origin is one of the "secret
things" that will remain wrapped in obscurity. Sin was first noted in the
heart of Satan. He was created a perfect being, " . . . Until
unrighteousness was found in you." (Ezekiel 28:11-19). Satan fell from
perfection when he exerted his will above the will of God. Five times he said,
"I will" (Isaiah 14:12-17). It was his will over God's will - this is
sin.
It is believed that Satan, when first created, was ruler of this earth (Genesis 1:1), and that he fell through self-will; and at his fall, the earth became "formless and void" (Genesis 1:2). Isaiah tells us that God created the earth "and did not create it a waste place" (Isaiah 45:18). He did not create it a chaos. The earth was a perfect creation in Genesis 1:1. Something happened that caused a catastrophe and the earth became "formless and void" (Genesis 1:2), but it was not created thus. It is believed that some of the angels, along with Satan, sinned by leaving their first estate. This does not prove that Satan was the originator of sin, but it does reveal sin in the heart of Satan before God created man."
(This is From : Bible Foundation Course Lesson 05- 02)