Most religions follow certain patterns. The whole purpose of mythology and/or religion is to provide answers to the big questions of existence... it only makes sense that mos people are asking similar questions:
Where did we come from?
What is our purpose?
Why is there evil in the world?
Etiological myths (stories about creation) are usually the first myths. A "deus faber" (craftsman god) who sculpted creation, not unlike a potter with clay, is a common enough assumption.
This God provides the believers with a necessary purpose: please Him, and He'll reward you... or at least not smite you today... if you're lucky, He might smite those bad people on the other side of the river instead...
Most myths/religions begin based in nature, and people tend to see dualism/ balance in nature: day/night, winter/summer, sun/moon... so when they believe that a person/thing is responsible for creation, it stands to reason that there must be a destroyer waiting in the wings... and there's your devil.
Or... they recognize that creation is imperfect, with certain things they can't imagine any benevolent deity placing there (death, disease, supply-side republicanism, etc...) and conclude that something is trying to sabotage the works... and there's your devil...