The question itself begs another, and that is: Does religion serve a singular goal, or is that goal multifaceted? It also implies that religion may serve some sort of intent. Perhaps the intent also is not singular, but multifaceted?
Religions can serve purpose(s). Those purposes can be man's or God's, or even a mixture of both. This is, to some extent, how I see various religions.