Before any of us came this earth, we existed in the presence of God as his spirit children.
Hebrews 12:9
9 Furthermore we have had fathers of our flesh which corrected us, and we gave them reverence: shall we not much rather be in subjection unto the Father of spirits, and live?
Acts 17:28-29
28 For in him we live, and move, and have our being; as certain also of your own poets have said, For we are also his offspring.
29 Forasmuch then as we are the offspring of God, we ought not to think that the Godhead is like unto gold, or silver, or stone, graven by art and man’s device.
Romans 8:16
16 The Spirit itself beareth witness with our spirit, that we are the children of God:
God is not an exnihilo creator. A part of man known as 'intelligence' has always existed. For this reason, God could not create us to be perfect since the intelligence of man has always existed. God combined the intelligence of man with a spirit body. These are the spirit children of God.
Doctrine and Covenants 93:29
29 Man was also in the beginning with God. Intelligence, or the light of truth, was not created or made, neither indeed can be.
Because God could not simply create man to be perfect, he had to devise a way for man to progress to become more like God. Part of that plan was to send mankind onto an earth and receive a physical body. There they would not be in God's presence but learn to walk by faith to see if they would be good beings in and of themselves. In order for them to be like God, it was essential that they have free will. God is a being of complete free will. For us to become like God we need to learn what we do on this earth by choice. You cannot become a completely good being without choosing of your own volition to be good.
In heaven, before the foundation of the world, Lucifer, a son of the morning, sought to overthrow the authority of God by introducing a different plan. His plan was a plan of coercion. He wanted to force everyone to obey. By introducing this plan he felt that he should be exalted to God's same status and run the whole show.
Moses 4:1-4
1 And I, the Lord God, spake unto Moses, saying: That Satan, whom thou hast commanded in the name of mine Only Begotten, is the same which was from the beginning, and he came before me, saying—Behold, here am I, send me, I will be thy son, and I will redeem all mankind, that one soul shall not be lost, and surely I will do it; wherefore give me thine honor.
2 But, behold, my Beloved Son, which was my Beloved and Chosen from the beginning, said unto me—Father, thy will be done, and the glory be thine forever.
3 Wherefore, because that Satan rebelled against me, and sought to destroy the agency of man, which I, the Lord God, had given him, and also, that I should give unto him mine own power; by the power of mine Only Begotten, I caused that he should be cast down;
4 And he became Satan, yea, even the devil, the father of all lies, to deceive and to blind men, and to lead them captive at his will, even as many as would not hearken unto my voice.
God, knowing that mankind could not progress unless they were allowed to do so by means of free will, rejected Lucifer's plan. At this point, Lucifer started a war in heaven by attempting to turn God's children against him and follow and worship him. He actually convinced 1/3 of the hosts of heaven to follow after him. God then cast Satan out of heaven and all those who followed after him (Satan's angels).
Revelation 12:7-11
7 And there was war in heaven: Michael and his angels fought against the dragon; and the dragon fought and his angels,
8 And prevailed not; neither was their place found any more in heaven.
9 And the great dragon was cast out, that old serpent, called the Devil, and Satan, which deceiveth the whole world: he was cast out into the earth, and his angels were cast out with him.
10 And I heard a loud voice saying in heaven, Now is come salvation, and strength, and the kingdom of our God, and the power of his Christ: for the accuser of our brethren is cast down, which accused them before our God day and night.
11 And they overcame him by the blood of the Lamb, and by the word of their testimony; and they loved not their lives unto the death.
Revelation 12:3-4
3 And there appeared another wonder in heaven; and behold a great red dragon, having seven heads and ten horns, and seven crowns upon his heads.
4 And his tail drew the third part of the stars of heaven, and did cast them to the earth: and the dragon stood before the woman which was ready to be delivered, for to devour her child as soon as it was born.
Isaiah 14:12-17
12 How art thou fallen from heaven, O Lucifer, son of the morning! how art thou cut down to the ground, which didst weaken the nations!
13 For thou hast said in thine heart, I will ascend into heaven, I will exalt my throne above the stars of God: I will sit also upon the mount of the congregation, in the sides of the north:
14 I will ascend above the heights of the clouds; I will be like the most High.
15 Yet thou shalt be brought down to hell, to the sides of the pit.
16 They that see thee shall narrowly look upon thee, and consider thee, saying, Is this the man that made the earth to tremble, that did shake kingdoms;
17 That made the world as a wilderness, and destroyed the cities thereof; that opened not the house of his prisoners?
What you need to understand about spirits is that they have no physical power over the physical world. They cannot kill, have sex, etc. It was a blessing for us to receive a physical body because there is more joy in having a physical body than not.
Doctrine and Covenants 93:33
33 For man is spirit. The elements are eternal, and spirit and element, inseparably connected, receive a fulness of joy;
For this reason evil spirits try to possess the bodies of those who receive them.
Mark 5:1-13
1 And they came over unto the other side of the sea, into the country of the Gadarenes.
2 And when he was come out of the ship, immediately there met him out of the tombs a man with an unclean spirit,
3 Who had his dwelling among the tombs; and no man could bind him, no, not with chains:
4 Because that he had been often bound with fetters and chains, and the chains had been plucked asunder by him, and the fetters broken in pieces: neither could any man tame him.
5 And always, night and day, he was in the mountains, and in the tombs, crying, and cutting himself with stones.
6 But when he saw Jesus afar off, he ran and worshipped him,
7 And cried with a loud voice, and said, What have I to do with thee, Jesus, thou Son of the most high God? I adjure thee by God, that thou torment me not.
8 For he said unto him, Come out of the man, thou unclean spirit.
9 And he asked him, What is thy name? And he answered, saying, My name is Legion: for we are many.
10 And he besought him much that he would not send them away out of the country.
11 Now there was there nigh unto the mountains a great herd of swine feeding.
12 And all the devils besought him, saying, Send us into the swine, that we may enter into them.
13 And forthwith Jesus gave them leave. And the unclean spirits went out, and entered into the swine: and the herd ran violently down a steep place into the sea, (they were about two thousand

and were choked in the sea.
Once Satan was upon the earth he tempted Eve who then convince Adam to partake of the forbidden fruit. This however, was known by God since he already has prepared a Savior from before the foundation of world to come and save his children.
1 Peter 1:19-20
19 But with the precious blood of Christ, as of a lamb without blemish and without spot:
20 Who verily was foreordained before the foundation of the world, but was manifest in these last times for you,
Satan then turned his attention to Cain through whom he introduced murder and secret combinations.
Moses 5:1-41
1 And it came to pass that after I, the Lord God, had driven them out, that Adam began to till the earth, and to have dominion over all the beasts of the field, and to eat his bread by the sweat of his brow, as I the Lord had commanded him. And Eve, also, his wife, did labor with him.
2 And Adam knew his wife, and she bare unto him sons and daughters, and they began to multiply and to replenish the earth.
3 And from that time forth, the sons and daughters of Adam began to divide two and two in the land, and to till the land, and to tend flocks, and they also begat sons and daughters.
4 And Adam and Eve, his wife, called upon the name of the Lord, and they heard the voice of the Lord from the way toward the Garden of Eden, speaking unto them, and they saw him not; for they were shut out from his presence.
5 And he gave unto them commandments, that they should worship the Lord their God, and should offer the firstlings of their flocks, for an offering unto the Lord. And Adam was obedient unto the commandments of the Lord.
6 And after many days an angel of the Lord appeared unto Adam, saying: Why dost thou offer sacrifices unto the Lord? And Adam said unto him: I know not, save the Lord commanded me.
7 And then the angel spake, saying: This thing is a similitude of the sacrifice of the Only Begotten of the Father, which is full of grace and truth.
8 Wherefore, thou shalt do all that thou doest in the name of the Son, and thou shalt repent and call upon God in the name of the Son forevermore.
9 And in that day the Holy Ghost fell upon Adam, which beareth record of the Father and the Son, saying: I am the Only Begotten of the Father from the beginning, henceforth and forever, that as thou hast fallen thou mayest be redeemed, and all mankind, even as many as will.
10 And in that day Adam blessed God and was filled, and began to prophesy concerning all the families of the earth, saying: Blessed be the name of God, for because of my transgression my eyes are opened, and in this life I shall have joy, and again in the flesh I shall see God.
11 And Eve, his wife, heard all these things and was glad, saying: Were it not for our transgression we never should have had seed, and never should have known good and evil, and the joy of our redemption, and the eternal life which God giveth unto all the obedient.
12 And Adam and Eve blessed the name of God, and they made all things known unto their sons and their daughters.
13 And Satan came among them, saying: I am also a son of God; and he commanded them, saying: Believe it not; and they believed it not, and they loved Satan more than God. And men began from that time forth to be carnal, sensual, and devilish.
14 And the Lord God called upon men by the Holy Ghost everywhere and commanded them that they should repent;
15 And as many as believed in the Son, and repented of their sins, should be saved; and as many as believed not and repented not, should be damned; and the words went forth out of the mouth of God in a firm decree; wherefore they must be fulfilled.
16 And Adam and Eve, his wife, ceased not to call upon God. And Adam knew Eve his wife, and she conceived and bare Cain, and said: I have gotten a man from the Lord; wherefore he may not reject his words. But behold, Cain hearkened not, saying: Who is the Lord that I should know him?
17 And she again conceived and bare his brother Abel. And Abel hearkened unto the voice of the Lord. And Abel was a keeper of sheep, but Cain was a tiller of the ground.
18 And Cain loved Satan more than God. And Satan commanded him, saying: Make an offering unto the Lord.
19 And in process of time it came to pass that Cain brought of the fruit of the ground an offering unto the Lord.
20 And Abel, he also brought of the firstlings of his flock, and of the fat thereof. And the Lord had respect unto Abel, and to his offering;
21 But unto Cain, and to his offering, he had not respect. Now Satan knew this, and it pleased him. And Cain was very wroth, and his countenance fell.
22 And the Lord said unto Cain: Why art thou wroth? Why is thy countenance fallen?
23 If thou doest well, thou shalt be accepted. And if thou doest not well, sin lieth at the door, and Satan desireth to have thee; and except thou shalt hearken unto my commandments, I will deliver thee up, and it shall be unto thee according to his desire. And thou shalt rule over him;
24 For from this time forth thou shalt be the father of his lies; thou shalt be called Perdition; for thou wast also before the world.
25 And it shall be said in time to come—That these abominations were had from Cain; for he rejected the greater counsel which was had from God; and this is a cursing which I will put upon thee, except thou repent.
26 And Cain was wroth, and listened not any more to the voice of the Lord, neither to Abel, his brother, who walked in holiness before the Lord.
27 And Adam and his wife mourned before the Lord, because of Cain and his brethren.
28 And it came to pass that Cain took one of his brothers’ daughters to wife, and they loved Satan more than God.
29 And Satan said unto Cain: Swear unto me by thy throat, and if thou tell it thou shalt die; and swear thy brethren by their heads, and by the living God, that they tell it not; for if they tell it, they shall surely die; and this that thy father may not know it; and this day I will deliver thy brother Abel into thine hands.
30 And Satan sware unto Cain that he would do according to his commands. And all these things were done in secret.
31 And Cain said: Truly I am Mahan, the master of this great secret, that I may murder and get gain. Wherefore Cain was called Master Mahan, and he gloried in his wickedness.
32 And Cain went into the field, and Cain talked with Abel, his brother. And it came to pass that while they were in the field, Cain rose up against Abel, his brother, and slew him.
33 And Cain gloried in that which he had done, saying: I am free; surely the flocks of my brother falleth into my hands.
34 And the Lord said unto Cain: Where is Abel, thy brother? And he said: I know not. Am I my brother’s keeper?
35 And the Lord said: What hast thou done? The voice of thy brother’s blood cries unto me from the ground.
36 And now thou shalt be cursed from the earth which hath opened her mouth to receive thy brother’s blood from thy hand.
37 When thou tillest the ground it shall not henceforth yield unto thee her strength. A fugitive and a vagabond shalt thou be in the earth.
38 And Cain said unto the Lord: Satan tempted me because of my brother’s flocks. And I was wroth also; for his offering thou didst accept and not mine; my punishment is greater than I can bear.
39 Behold thou hast driven me out this day from the face of the Lord, and from thy face shall I be hid; and I shall be a fugitive and a vagabond in the earth; and it shall come to pass, that he that findeth me will slay me, because of mine iniquities, for these things are not hid from the Lord.
40 And I the Lord said unto him: Whosoever slayeth thee, vengeance shall be taken on him sevenfold. And I the Lord set a mark upon Cain, lest any finding him should kill him.
41 And Cain was shut out from the presence of the Lord, and with his wife and many of his brethren dwelt in the land of Nod, on the east of Eden
It is the purpose of God to have his children to progress to become more like him. It is Satan's will to thwart the plan of God. Satan is the father of lies, murder, deceit, etc. etc.