NEUTER WORDS
The word religion is found twice in the letter of James. In itself it doesn't have a positive or a negative connotation. It needs other words to define it. This is not something new. The New Testament has many examples of words that although in themselves “neuter” may have striking and sometimes opposite meanings.
Think about the word god/God. The word might refer to the only and wise God and to the god of this world (Satan). Or consider the word father/Father. The word often refers to God our Father but also to Satan the father of lie.
In the letter of James we have the example of the wisdom that comes from above and the wisdom that is devilish.
Jas 3:14 But if ye have bitter envying and strife in your hearts, glory not, and lie not against the truth.
Jas 3:15
This wisdom descendeth not from above, but is earthly, sensual, devilish.
Jas 3:16 For where envying and strife is, there is confusion and every evil work.
Jas 3:17
But the wisdom that is from above is first pure, then peaceable, gentle, and easy to be intreated, full of mercy and good fruits, without partiality, and without hypocrisy.
For James, religion can be vain (1:26) or pure (1:27).
Jas 1:26 If any man among you seem to be religious, and bridleth not his tongue, but deceiveth his own heart,
this man's religion is vain.
Jas 1:27
Pure religion and undefiled before God and the Father is this, To visit the fatherless and widows in their affliction, and to keep himself unspotted from the world.