What is religion good for? I don't mean that as a rhetorical question. Religion is good for some things, or it wouldn't be such a persistent feature in all cultures.
In asking that non-rhetorical question, I would like to avoid simplistic, pat answers such as "it reassures people and calms their fear of death," or "it explains things that primitive people found beyond comprehension." Not all religions even include a concept of the afterlife, and some that do have afterlives far scarier than death, such as the Christian Hell. Actually, death isn't all that scary. Dying is, because it usually hurts, but death itself is no more frightening than sleep - unless one imposes upon the imagination horrors such as Hell. Death is something to be regretted if it comes too soon, not for its own sake, but because of lost opportunities, but it is not something to be feared, and many religious beliefs tend to generate, rather than calm, fears of death.
As for primitive explanations for natural phenomena, we should understand why people want to explain things in the first place. It's not just for mental comfort, but also for practical reasons. "Why didn't my wheat grow?" is best answered by "because the rains didn't come" or "because the crows ate it," as these admit of practical solutions: irrigate from the river; plant the seed deeper; make a scarecrow. A religious answer to questions like these might prompt the working of magic (such as prayers or sacrifices), which could do some good, but is no substitute for practical solutions in the material world, although it may enhance those solutions' effectiveness. Religious explanations for things completely outside human control may offer some mental comfort, but no practical utility, and this quite minimal benefit cannot explain the persistence of faith.
So what does religion give people? I'd say that there are two main benefits, one individual and personal and the other collective and social. I'm more concerned here with the collective and social benefit, but to get the other out of the way, I'll simply say that spiritual experience is real. Individual identity is in the end an illusion, and masks our true position as one with everything else in existence. However dimly, most people occasionally have perceptions of this, and it is a very moving and powerful experience that is extremely difficult to articulate or to understand rationally. Religious teachings give it a framework by speaking of consciousness and intelligence beyond human limitations, in one form or another, embracing and supporting the human soul. All such teachings are metaphors, none are literally true, but they have the virtue of saying to a person who has undergone a spiritual experience: yes, you have touched upon something real. You are not mad. So long as religion does this, and so long as nothing else does, religion will exist.
The other benefit of religion is the articulation and reinforcement of common values. And this brings me to the title of this writing: the morphology of religion. Because common values are not a constant. They change, and so religion also changes. We have seen this in relatively modern times, as Christianity has morphed from a religion that accepted (for example) the existence of slavery into one that condemns the practice, or as Islam, in being transmitted from the Middle East to western nations, sometimes loses its most misogynistic elements. But a much larger change occurred in the distant past, long before either Christianity or Islam existed, as our ancestors settled into farming communities and began building cities. In doing this, they entered a material reality requiring radically changed common values.
All of the so-called "great" religions, including without limitation Judaism, Hinduism, Buddhism, Islam, Christianity, Confucianism, Taoism, Jainism, and Shinto -- I'm sure I've left some out, so if you're a follower of one of those I did, please accept my apology -- emerged during the time of agrarian civilization, after the founding of the first cities but before the industrial and scientific revolutions. So did many other religions that have not survived, such as the polytheistic faiths of the Greeks, Romans, Phoenicians, Gauls, and Germans of antiquity. Certain features were common to all agrarian civilizations, mandated by the material circumstances that defined them. These included a universal elevation of a hereditary warrior-landholder elite (and normally but not quite universally a monarch above them all); a base class or caste of forced laborers, most commonly slaves but sometimes serfs or peasants; drastically low status for women, who normally subsisted as the subordinate property of men, their only real purpose in life to bear children.
Most basic of all, so universal that it is seldom noticed, was a belief that man is superior to and dominant over nature. This belief was not held in precivilized forager-hunter societies, but it's necessary if humans are to cut the earth with plows, kill the plants that nature has bid to grow in certain ground, and replace them with other plants of the farmer's choosing. It's equally necessary if humans are to enslave animals for meat, hides, milk, eggs, wool, and labor, rather than taking wild, free prey like other predators. Many of the other institutions of agrarian civilization follow from this basic change, either logically or by association. As man is dominant over nature, so some men are dominant over others, and men over women, and the Gods over men. As for the status of women, that follows pragmatically from the increased food production available with agriculture as compared to foraging and hunting. An increased food supply means that it is possible to have a larger population, and since it is possible, by competitive necessity it becomes mandatory. As we know in modern times from studies of how to reduce population growth, women who control their own reproduction tend to have smaller families. Conversely, women who don't control their own reproduction - women who are the brood-slaves of men - tend to have larger families, and so when large families and high birth rates are what is desired and needed, the status of women necessarily falls.
All of the so-called "great" religions, as well as others from the same period that have not survived, have teachings that reinforce these values. The institution or sacrament of marriage is one of these. Marriage in origin was a most unequal relationship, a transfer of female human property from a father to a husband. That our thinking about it has changed is a good example of religious morphology. But it was always an institution that encouraged high birthrates. By making a woman the property of a man with sexual rights to her person, and insisting that her purpose in life, the only reason she exists at all, is to bear children, this institution made sure that many children would be born, and born into a situation in which they could most effectively be raised. The sexual morality common to the "great" religions also reinforces this breed-to-the-max desideratum, channeling all sex into heterosexual relationships that are best for raising children, and often condemning sex for its own sake, as well as homosexuality and other non-procreative sexual acts.
We are again in a period of transition, as our ancestors were when they let the plow replace the foraging basket. Today, we must be concerned with human mismanagement of nature and damage to the natural world, and so "man as overlord" is not a very useful mythos. We are also past the time when maximizing birthrates is a good idea. Exactly the opposite is true today. And so, to one degree or another, the so-called "great" religions are all changing, and new religions are arising to express spirituality and common values in less anachronistic fashion.
But in addition to this, another change is happening through the process of intellectual globalization. We now have what amounts to a global conversation taking place, and the subject of religion naturally arises as part of it. It's no longer feasible for a religious belief to isolate itself from the impact of ideas from outside itself. And so we see such things as Christian churches adopting meditative practices from Hindu and Buddhist sources and labyrinths and other symbols from Neopagan ones. We see people who consider themselves spiritual and religious not confining themselves to a single faith, but picking and choosing elements from among various offerings to, in effect, craft their own approach. In such a climate, an exclusivist, "We have the only true way" approach to faith becomes increasingly untenable.
None of these changes are comfortable ones for traditionalists and purists. And that, I believe, is why we see phenomena such as radical fundamentalist movements in Islam or Christianity. These people see their faiths threatened by the changes of modernity, and they are right to do so. But theirs is in the end a lost cause, because there is no way to turn back the clock on the material changes that are driving the process. And since one of the two purposes of religion is to articulate and reinforce common values, and common values must and do change to be relevant to material circumstances, so religion must and does change as well.