The creation of gods / spirits may not have begun as a means of control. It's reasonable enough that people with limited scientific capabilities would, in seeking to understand the world, assume that events are put in motion by people much like them but with super-powers.
Most of the great mythologies are full of characters and stories representing human traits, actions and consequences as well. All in all, they provide a set of answers to people's questions "Why?" They attempt to answer "How", too. If global sea serpents, demons or smiting hands don't do it for you, there's a hundred different ways to say gods don't share their trade secrets with puny humans.
That naturally opens the door to priests and shamans, etc, who claim a special relationship with the gods / spirits. They rapidly became the most powerful class in every culture I can think of. They directed war, politics, economics, medicine, engineering, education, the arts, social structures and family life. As soon as humans had religion, no aspect of life was uninvolved with it.
Even after science and philosophy developed as disciplines, they were studied as part of religion. That went on for millennia - separation only began three hundred years ago, less than a tenth of the time religions held absolute sway. It's unsurprising that they're still inextricably linked for so many, and 'feel true' to many more.
I think there's a simple root to this - it pisses off a lot of believers, I'm afraid. Infants perceive their adult caregivers as godlike: they are the source of sustenance, shelter, protection and knowledge. It's hardwired in most young animals that are unable to provide for themselves. My theory is that this psychological 'wiring' never really goes away. We become independent, but carry on feeling like there should be some authority that's got all the answers and will be there for us when we need it. It's an easy space for a priestly class to step into.
Others have pointed out similarities between dogmatic religions and abusive parents. Maybe, like children who must try to get along with their abusers for their own survival, people have long accepted poor treatment 'in the name of god' because 'god' has filled a parent-shaped space in their subconscious mind?
(I could've written that last paragraph better, but hey.)