Actions in the world do not need to be rational - it's possible to cook a meal following a 1000 year old recipe that is perfectly nutritious, even though it was devised by someone who had no knowledge of biochemistry. In fact the recipe had been tested by time (and evolution) and had proven itself to increase the survival of the those who ate it.
Religion is just a bunch of recipes for survival - it is tested by evolution and works in reality as it is, rather than a reality scientifically modeled.
Reality that is scientifically modeled may prove itself to increase survival, but since the individual is ignored by the model (ie the model doesn't tell them how to live day to day), people my be inclined to ignore it and prefer to find a system that allows them to justify what it is they actually do with their lives.
Science ignores what we do as individuals.
Science tells us that we are irreverent specs of dust in a meaningless universe - that our sense of self is just a genetic innovation that improves our chance of survival so we can pass on our genes.
Ironically, believing this may not increase our chance of survival (which is all that 'matters' to our genes) - hence religion continues to survive