Dagon was once an angel, who decided to take part in Lucifer's revolution, alongside 10 million other angels. All rebel-angels were cast into Hell, and became the demons.
In Hell, Dagon became known as the "Lord of the Files" and "Master of Torments".
Dagon likely influenced humanity over its history to create the ancient Mesopotamian and Canaanite Deity of the same name.
Behind the Mythos
Whether due to simple lazy namechecking or the author's support of the Derlethian dualism version of the Mythos, the placing of a Mythos entity as a demon seems to reaffirm the good vs evil motif Derleth favoured.