This is a really challenging question and all the more because we are talking about angels (a subject about which we know precious little), plus we usually attempt to reconcile such things with our own reality as human beings. And yet angels are "higher beings" than are humans (according to Psalm 8:5) and therein lies the mystery.
But Jesus gives us an interesting tidbit of insight when He spoke about Satan saying:
John 8:44 (ESV)
You are of your father the devil, and your will is to do your father’s desires. He was a murderer from the beginning, and does not stand in the truth, because there is no truth in him. When he lies, he speaks out of his own character, for he is a liar and the father of lies.
The wording here is most interesting. Jesus referred to Satan as "...a liar and the father of lies." When the Bible refers to someone as the "father" of something it speaks of that person as the originator or starting point for something. For example, Abraham is called "the Father of the Jews" since the Jewish race began with him. (Luke 1:73; Romans 4:1)
This term is also used prophetically to speak of Jesus in a popular passage from Isaiah:
Isaiah 9:6 (ESV)
For to us a child is born, to us a son is given; and the government shall be upon his shoulder, and his name shall be called Wonderful Counselor, Mighty God, Everlasting Father, Prince of Peace.
Did you notice that Isaiah said that Jesus would be called "Everlasting Father"? This is not because He is being confused with God the Father, but rather it means "Father of the everlasting" or, if you will, "father of eternity" which biblically means the originator of all eternity.
So, when Jesus calls Satan the "father of lies" in John 8, He is saying that Satan is the originator of lies. That means lying and deception started with him. How? We aren't told since no evil existed before...but that is what makes Satan so evil. He originated it before it ever existed.
Ezekiel 28:14-15 (ESV)
You were an anointed guardian cherub. I placed you; you were on the holy mountain of God; in the midst of the stones of fire you walked. You were blameless in your ways from the day you were created, till unrighteousness was found in you.
So, the origin of sin is a fascinating study but all biblical evidence points to Satan as the mysterious originator of sin, lies and deception.