I just read a quite lengthy blog by a Christian discussing this question. In the end, the writer could not decide if God created Satan and, if he did, why.
It is refreshing to find people in the faith admit the faith is a confusing and lacks much semblance of logic. The idea that God, who is supposed to represent all that is good, would also represent all that is bad, is confusing.
The question of why God would create a evil Satan is mute if one accepts that the god is created in the human mind. This points to Satan as well as created in the mind. One of the most famous believer in a literal Satan is none other than Pope Francis.
So, if Satan is a creation of the mind, why do minds so enthusiastically talk of a Satan. There must be some need in humans to do this.
Nearly all stories written for either the purpose of entertaining or informing have a similar pattern. Good is confronted by evil. There is a struggle. Good eventually triumphs over evil. This pattern is also how the Bible itself plays out.
It seems, then, the human mind creates a Satan because the mind needs someone or something to defeat. If the mind has created a hero there needs to be someone for the hero to defeat. A Satan fits the bill.
We need a demon to defeat. It cannot be too big or too small.
Satan, we’re glad you showed up.
[A blog discussing Satan is linked in Comments.]