Why did people need to believe in the gods or goddesses?

For the same reason they do today. to replace the father and or mother that they no longer have. it is also an easy way to explain all the wondrous things around you without going to the trouble of thinking about them.