James was talking about PURE religion, not fake, performative, unprofitable ones that Jesus specifically called out in the Sermon on the Mount.
I read the rest of the message and kind of think along the same wavelength.
if there is a form of religion that is pure, then preachers or rappers saying that 'religion is bad' are wrong, because only some of it is bad. Pure religion is good. Vain religion is bad. It just makes more sense if we do not make up 3 or 4 definitions of a word that do not match up with the Bible or what 99% or hear us talk think the word means. Then Christians say 'religion' and think all these different ideas of what it means and may get the wrong idea from the speaker.
My first exposure to the critic of the word religion was from a football player evangelist. I think he was Bill Blass. He said religion is man reaching out to God, but Christianity is God reaching out to man. I do not think the part about 'religion' was particularly helpful, but I was a child and probably do not remember how that fit into his message. It might have made sense if I did not catch how he fleshed it out.
It was probably more along the lines of Karl Barth's commentary than these confusing evangelical cliches and pulpit-parrotted sayings I hear today. Preachers can be in an echo chamber and repeat each other. If it is good stuff, that's fine. But sometimes something not helpful, silly, confusing, or downright unhelpful gets into that echo chamber and bounces around for years. I think I have seen that with unexplained over emphasized focus on the word 'personal' in evangelistic presentations and especially with the word 'religion.'
Some criticisms of 'religion' are confusing but might be helpful if they are explained. Some are downright harmful and teach ideas that aren't Biblical.
Even the evangelist I mentioned who said Christianity was man reaching out to God-- what is wrong with that? Doesn't God's grace work in individuals to reach out to God? And what about Jeremiah's prophecy from God to Israel that if they seek Him they will find Him if they seek Him with all their heart? What is wrong with reaching out to God? And what about Paul's words to a bunch of pagan Gentile heathens who worshipped idols, "He did this so that they might seek God, and perhaps they might reach out and find him, though he is not far from each one of us. " (Acts 17:27 CSB.)
If man reaching out to God is religion, it does not make sense to be against religion. We want God to be in our religion. Outward expressions of faith CAN be holy. Paul writes about the offering up of the Gentiles being sanctified by the Holy Ghost. Our religion must be sanctified. God works in us according to his pleasure. So outward expressions like going to church, praying, etc. can be sanctified.
But IMO, the idea to start using 'religion' to mean hypocrisy and a vain show is a foolish decision. On one hand, its like someone grew up speaking a different language where one word means something different. It's like the American preacher who went to England and said in a sermon that we all put our pants on one leg at a time and the audience laughed because they say 'trousers' in that saying and pants are their underpants. The British have one definition of the word. The Americans have another. But I saw the word 'religion' change, and I think going along with the change was foolish, and the Christians speaking this little dialect where 'religion' is bad need some language education and to think about damaging their words can be. I also suspect we might have got this religion is bad idea from some carnal 'spiritual but not religious' people the Jesus people tried to reach and accepted their words... and worse their ideas.
They might have just got it trying to relate to Hippies who said, "We don't want religion. Religion is for squares man' and came up with sayings. Maybe they were influenced by Karl Barth's old writings a little bit, drawing on just a little of his concept. I share some 'anti-institutional' concerns when it comes to church, but 'religion' can be highly institutional or personal devotional habits. They can be good or bad.