I am describing its original purpose in the sense of prayer's original purpose in psychology and sociology.
One can learn lessons from religious practices without becoming religious in the process.
Besides prayer in general, take another look at the step:
... improve our conscious contact with God as we understood Him, praying only for knowledge of His will for us and the power to carry that out.
Do you know what that is? Look at it as an athiest, and imagine what purpose that step serves.
Seeking to understood God and his will? That's not - as many would put it - a human trying to communicate with a Sky Dad.
That's a human trying to understand his own Coherent Extrapolated Volition: "our wish if we knew more, thought faster, were more the people we wished we were, had grown up farther together; where the extrapolation converges rather than diverges, where our wishes cohere rather than interfere; extrapolated as we wish that extrapolated, interpreted as we wish that interpreted"
https://en.m.wikipedia.org/wiki/Friendly_artificial_intelligence
When a human makes a gesture and a sound on cue, they're usually engaging in in-group signalling. But when a human prays and meditates on finding God's Will for them, they are trying to imagine their own desires and needs from the standpoint of a superior being. One with more information, a greater mind, a greater moral compass. They are trying to make themselves better by imagining the ways they could be better.
Athiests do this too, they just call it cognitive behavioral therapy and moral philosophy.
No, they haven't always been extremely greedy and selfish. All social animals strike a balance between self-interest and group-interest, and humans are no different.
Some humans have always been extremely greedy and selfish. And some of those humans have always been charismatic and persuasive. And many other humans are not equipped to differentiate between emotionally persuasive and right. Well-intentioned humans will often connect themselves to the wrong people or ideas.
That's not really their fault. We're repurposing evolution's creations for things they weren't built to do. We're trying to build empathy and connection with people that are chronologically, geographically, and/or psychologically distant from us.
And unfortunately we're trying to do that while a handful of us try to sever those connections and build physical and metaphorical barriers between us for their own self-interest.
Most of us struggle with the ability to feel empathy and connection with our own future selves. We often choose instant gratification over personal benefit, we often choose to forego temporary burdens in the present at the foreseen expense of finding greater burdens in the future.
That's not greed or self-interest. That's the opposite of self-interest. That's just the burden of the rising ape. But it's no reason to lose hope, and it's no reason to stop trying.
The most important proof that humans aren't all greedy and selfish is that people are still trying to do better. We are still trying to build better connections, even as others try to tear them apart.