Yes, YABU. You've listed a load of perceived 'needs' that you think religion used to fulfil but doesn't any longer. But for people who are religious believers, their belief is not based on answering scientific questions, or needing moral deterrents, and the charitable work is as a result of faith rather than a reason for it. People who are believers are not seeking to solve the problems that you've listed, at least not at a primary level. Believers have faith because they trust that faith to be true and therefore worthwhile. Faith in God is an end in itself, not an answer to a sociological question.
It is definitely the case that religious practice has declined in the UK and western Europe recently and appears to be still declining as older believers die off and are not replaced because younger generations are brought up with no religion. A friend of mine does his academic research/teaching on this, and there are numerous reasons which would take pages here. Definitely a proportion of the people who used to practise but don't now were looking for the kind of thing you mention. So, to the extent that fewer people are practising, the role of religion may decline. But there is evidence that the people who are still practising (or who have begun to practise from not being religious) are on average more committed to their faith identity than in previous generations.
Summary: fewer people in this country practise a religion. In that sense, its societal importance may decline. OTOH, the people who do practise increasingly want to integrate and express their faith in all areas of their life (increasingly compared to the 20th century, since previous comparisons are difficult owing to the different societal norms etc.); in that sense its societal importance may increase.
Two more points: 1) as has been mentioned upthread, the UK situation is not the worldwide picture and the UK can't be seen in isolation.
And finally (on this part), many of the more committed believers tend (again, only on average) to have more children than the UK average; just by numbers of people born into the faith, what might be seen as 'fundamentalist'/'hardcore' Christians, Muslims, and Jews are growing faster than their less committed/'moderate' counterparts.
Also, on a scientific level, you either don't understand what evolution is or you've accidentally chosen the wrong word. The evolution of the human race could go in any direction, it is not a relentless improvement, at least not from any objective viewpoint of what 'improvement' might mean.
If human intelligence is increasing (scientifically possible but not definite), it is not on a timescale that can be measured by the decline in religious practice in the past couple of hundred years. It is definitely not the case that our ancestors in the past couple of millennia were gullible and stupid and lucky us for being so clever and evolved and not falling for that stuff any more.