The horrendously wicked spirit-being that we now know as Satan has not always existed. He was created by God, not as the evil rebel that he is now (see The Lame Duck), but as the above Scriptures describe, perfect in wisdom and beauty. Satan, or Lucifer, was, at a time long ago, perfectly righteous and obedient before God. Put another way, at one time, he could have been one of the best friends that any Christian could have!
But Lucifer went bad, very bad -
Satan didn't just refuse to obey God any longer, which was bad enough; he actually tried to overthrow God! The attempted coup failed of course, as described by Jesus Christ: "I saw Satan fall like lightning from heaven." (Luke 10:18 RSV). This would have occurred long before His birth in Bethlehem as a human (see The Logos and Rock Of Ages). Satan was still on earth during the time of Jesus' ministry (see Go Ahead, Jump! and That Old Serpent), and was directly involved in His betrayal by Judas Iscariot (see Why Did He Do It?).
God created the perfectly-righteous Lucifer, by God's choice. Lucifer created the absolutely-wicked Satan, by Lucifer's choice. Lucifer, and all of the millions of angels had the power of choice - to obey, or to rebel. Most chose to obey God, while some followed Satan's rebellion and have become hopelessly corrupt (see Could Satan Repent?).
Why did God allow choice? Well, using human marriage as an analogy, would you want to be married, forever, to someone who had absolutely no choice in the matter? Or, would you want to be married to someone who personally chose to spend their life with you?
The angels were not created like mindless machines. Biblical accounts of them show that they are individuals with powers of reason. Good angels are capable of patience, joy, compassion, curiosity, and sometimes anger. Angels have personal names e.g. Michael and Gabriel.
God did not force the angels to obey Him. Was anything at risk? Not really. Even though angels are very powerful, God remained, and will always remain, absolutely supreme in power and authority over any number of them. The only thing lost when an angel rebels against Him is the angel's own glorious future - a principle of choice that applies as much to humans, as it does to angels.
Lucifer wasn't born to be wild - he went wild, all on his own. The result of his rebellion against the love and the law of God is that he is now the greatest loser of all eternity. The second-greatest losers of all time are those who, tragically for themselves, repeat the devil's mistake.
Fact Finder: Does God want humans to choose life by obeying Him?