Maybe I am overthinking this but to me it seems like the creation of the devil was necessary. Before the devil was created, every good and bad thing that happened was attributed to god. Then humans were blamed for evil because they are greedy, jealous, violent etc. I think that the creation of the devil was necessary because the devil becomes the villain that people can blame for all evil and suffering in the world. Nothing brings people closer than a common enemy. Additionally, like Stephanie Garber said every good story needs a villain.
This is just my thoughts so I could be wrong since the concept of the devil did evolve over time. #religion source