There is a complicated issue as to whether a belief in a purpose for human existence commits you to some religious view or other. One ordinarily thinks of purposes as requiring a purposer. Aristotle was one philosopher who did not think in this way; there is an inherent purpose for human life but it is not a purpose intended by the Unmoved Mover (Aristotle's version of God) but is inherent in human nature itself. However, modern forms of atheism, such as materialism, tend to eliminate that kind of purpose as well. On these atheistic views we acquire certain behavioral propensities from nature, we are taught other in order to make us easy to deal with as members of the social groups of which we are a part, and it seems as if on these world-views the question is left open as to whether "being moral" is in our interests as human beings or not.
Behaving in ways that at least appear moral seems necessary for the fulfilment of the goals of many of us as social beings. But we also have social motivations for doing things that morality ordinarily considers to be wrong. You faced a lot of disapproval if you opposed segregation in the pre-civil-rights South, for example. We also have sympathetic feelings for other people, and those feelings often push us in the direction of socially praiseworthy behavior, with or without religion. But sometimes the sentiment of sympathy can lead us to act unjustly.
But if our makeup isn't terribly social and isn't terribly sympathetic, what motivation to we have to be moral?
Buddhism, of course, has no God, per se, put it has an ulitmate goal for human life: Nirvana.
Adding religion to the mix is also double-edged in the sense that if someone can convince themselves that what they want to do is what God wants, even though it isn't what most of us would call moral, how do you argue with them? How do you argue against God? But at least rationally, such religious position can be criticized from the standpoint of religion itself.