The original name given to the devil was Lucifer (Isaiah 14:12), which means "son of the morning." He was created with unmatched wisdom, beauty and musical talents (Ezekiel 28:12 - 13, 15). God himself declared, "you seal up the measure of perfection" (Ezekiel 28:12, HBFV throughout). Lucifer was the greatest being the Eternal could create from scratch (verse 15).
Lucifer, after he was created, was blessed with the responsibility of serving God at his throne (Ezekiel 28:14). After faithfully performing this task, he was rewarded with a new job. He was given his own throne with the critical role of supervising, on earth, one third of all the angels (Isaiah 14:13, John 12:31, Revelation 12:3 - 4). It was during this responsibility that he became the devil (Isaiah 14:13 - 14, Ezekiel 28:15).
God can bless any individual he brings into existence with a plethora of gifts, talents and powers. There is one critical attribute, however, he could not give Lucifer to insure he would never reject his ways and turn himself into the devil. He could not give him, when created, the same unchangeable nature of his righteous that he possesses.
The attainment of holy character that will never change requires choices made over time (Ephesians 4:13, Philippians 3:12, 2Timothy 3:17, Hebrews 13:21). The intensity or zealousness of the thoughts and behavior also plays a vital role (Romans 12:11, James 5:16, 1Peter 4:8).
Christians are promised that if they lead a faithful life of overcoming and obedience they will be sealed sinless and forever holy (1Corinthians 15:52 - 54, Romans 8:21, Revelation 21:7).
Rejecting his reward
Lucifer was rewarded with more responsibilities by God, and a far more active role in serving others, as an opportunity to seal his character in righteousness. He choose, however, to believe his new authority, coupled with his unique attributes (e.g. beauty), made him better than everyone else! This led to him becoming vain (Ezekiel 28:17) and turning into the devil.
It is possible that Lucifer turned himself into the devil within a relatively short period. His shift from the way of God to a vain and violent (hate intense) lifestyle, coupled with the frequency and intensity of his evil thoughts (referred to as "the multitude of your merchandise," see Ezekiel 28:16 - 18) may have led to his character quickly and permanently setting to evil.
God did not directly create the devil. It was Lucifer who made and brought evil into an otherwise perfect universe (John 8:44). He then promulgated, to other angels, the same deceptions and lies he believed. The Eternal, however, is ultimately responsible for his creation. He will soon permanently remove all evil from the universe so that the righteous may enjoy eternity in peace (see Revelation 21 - 22)!