Why did human beings need religion? Most attempts to imagine origins of human behavior in pre-historic times are remarkably uninformed. People make suppositions based on imagining the thousands of years when we became human about on the level of a Flintstone cartoon.
I don't claim deep knowledge but thanks primarily to reading Paul Shepard I can do better than that. So my answers may be a little different. I surmise that our ancestors at the dawn of humanity had to find ways of dealing with these perplexing observations:
1. I who am alive will die. All living things die.
2. Beings live by the death of other beings, other living things. The animals we admire and learn from, the animals we fear and strike us with awe, we must kill in order to live.
3. In the human realm, people can be good, generous, honorable, just and reasonable. And people can be cruel, vicious, unjust, and their victims are often innocent.
These are basic problems of human existence. They are the more pressing and practical conundrums, although the cosmic questions may have also soon arisen: How did everything get here? Is there anything beyond what I can see? Is there knowledge that can reveal the truth of all this?
Dealing with these paradoxes can be seen as the root of human civilization as well as religion. How they both developed is another story. Perhaps with its root in primate behavior, both civilization and religion became centered on authority figures, on kings. But apart from gods and kings, dealing with these paradoxes is fundamental to human life and human civilization.