And I can see where you might get this view from, because in ancient religions the priests were often the only scholars, so they performed all of the roles that a scholar should perform. Not only were they the scientists, but they were also historians and keepers of law. And they did not perform these functions separately, but they wholistically put them all together, because being a priest (or shaman or whatever you want to call it) naturally included all of these things so there was no reason to separate them out.
However there are other functions that religion performs that are still important today.
1) It helps people to understand their place in the world.
2) It guides people toward living a wise life.
3) It provides a way for people to deal with the fear of death.
4) It helps people to connect with that which transcends the "here and now".