God did not create evil.
God could have made people in such a way that they would be robots who would react when God made them do so. But that would not give his most precious creation any significance. imagine being an Angel of God(Outside of Lucifer of course), filled with power and can do great things in the eyes of the lord by whom you're empowered by (A Holy Tool of Purpose) , but Angels being so close to God, that they have seen his unwavering wrath and what comes to those who ultimately deny him: you are literally scared(in respect and in awe), So Angels are one slip up away from eternal damnation) So they are Perfect with a condition, God made Lucifer so splendid, Literally the most beautiful thing in the history of his creation, Filled him with nigh limitless power, and with that (Lucifer got to taste what was given to man kind): "
Free Will" - and with the power he possessed his eyes were opened and saw that with that power - he is not God's most important creation - So he slipped up and chose to defile his brethren

basically he ate his piece of fruit in heaven when he took his free will into his own hands,
he knew that giving mankind an alternative look on life could lead them away from God, God wanted to see what choice his creation would make in the same circumstance... idk. just me and my spin with a little inspiration.