Because in medieval cultures religion was kind of a big deal. In a world that has a ton of magic being blown about it’s rather easy to include the existence of mythological beings such as dragons, ghosts, and gods.
This is the kind of silly question that makes us Atheists look obnoxious, just fyi.