I think it’s not that religion is good or bad, it’s what you replace it with. Humans are in some sense geared to mythical beliefs - believing in something higher than us sort of like a father figure, there is a reason every famous work of art or fiction exploits that - be it Harry Potter or Game of Thrones. You can go way beyond in the past and cave engravings and such also seem to tell the same story.
Wiping out clean religion (or the sense that there is a father figure watching and judging you) seems to have had bad consequences wherever it has been tried. And it has come back with vengeance. Go to StPetersburg in Russia in a church on Sunday - all the churches are almost full to the brink.