Someone put it quite well to me that religion will continue to prevail until the human race can better articulate the "meaning of life". It's quite a fundamental human yearning to want to understand how and why we're here, to assign some grand purpose to the things we do...
There are aspects of all religions which come from a good place, and aspects which are antiquated. It's difficult to reject some teachings while retaining others. Some denominations of Christianity have managed to do this better than others. There are moderate Muslims just as there are extremists.
Fundamentalists that invoke religion (eg. Daesh, KKK, Babbar Khalsa, many, many, many more) tend to do so to put in place power structures, rather than being true to the core fundamentals of the religions they claim to represent (in my view anyway). They have corrupted religion to serve their needs. That is absolutely immoral. But there are many examples of positive actions and examples of morality that stem from religion. I would contend that many modern "Western" constructs of morality have evolved from a Judeo-Christian teaching, those being the dominant religions of Europe and America for some time. It's a shame that those moral centres are only just coming around to the idea that, perhaps women aren't objects, or that being gay is okay... but there will always be things that seem outlandish now, even to those who aren't religious, that will be accepted in ten, fifty, a hundred years... that's how it's always been.
Many intelligent people choose to have faith, or have always known faith. I would never consider it my right to tell people who have a religion that they're stupid.