God did not create evil beings. All beings that God created are good by nature. Beings become evil when they turn away from God and into themselves; when they become selfish.
The devil was an angel that should have praised God for all eternity, but he chose to betray God. All the demons were also once angels who then betrayed God as well.
Traitors, criminals, fornicators, thieves, vandals, gluttons, drunkards, cheaters and murderers were once innocent children. But, due to various reasons, they ultimately chose to commit evil.
But, you might then ask, why did God create beings that He knew would turn against Him?
The reason is because God does not want to make decisions for us. He wants to give each of us a choice of whether to serve Him or not. He gives us rules to follow for our own good, but it’s up to us to follow them. So, even if He knows that one of His creations will betray Him, He will still create that being because He loves that being. But, He allows that being to choose whether to love Him in return or not.
God loves us so much that He wishes for us to exist. But, those who are evil are evil because they chose to betray God.