Creating a fantasy world from scratch is a daunting enough undertaking, what with having to decide what it looks like, how its culture works, if the world has magic, or dragons, or sea monsters. You need a history, a timeline, a sense of logical consistency. And, unless your fantasy world is steeped in science and Atheism (which, now that I think about it, might be awesome) you’re probably going to need a religion.
Religion has, from the times of men looking up at lightning and surmising a god must be up there throwing down electric bolts, stemmed from a need to explain the inexplicable. And, in a fantasy world, there’s probably a lot that’s inexplicable. A fantasy world might fear sea monsters as demons, might revere dragons as gods, might think magic comes from people touched by the heavens — or by those sprouted from hell.