Humans are naturally scared of the unknown; it's yearning, but also frightening by the sheer amount of things we do not know. Anicient humans recognized this and wished for an explanation. In the more craftier beings, some created mythical beings responsible for the creation of their world. Hence, religion.
It's really not all that necessary in our advancing society any more. We no longer need gods to explain the mysteries of life and have begun to find the gods just get in the way of us getting a real understanding of reality.