Then later James says:
James 3:8
8But the tongue can no man tame;
it is an unruly evil, full of deadly poison.
So while on one hand if you can't bridle the tongue your professed religion is worthless and on the other hand the tongue can't be tamed.
I think the word religion used here isn't like what we may intuitively think. I had to look it up and it refers to ceremonial observances. See Acts 26:5.
As we know, Jesus taught that it is what proceeds out of the mouth of people that defiles them. What someone says comes from their heart where evil originates from. See Matthew 15:10-20.
So what is the conclusion here? Religion is worthless. What matters is true heart change and manifesting those fruits of the Holy Spirit. God sees the inward man. Once our heart is pure the words that come out of our mouth will be pure.
True worship to God is not ceremonial observances, but instead a life dedicated to God in love.
Romans 12:1-2
1I beseech you therefore, brethren, by the mercies of God, that ye present your bodies a living sacrifice, holy, acceptable unto God,
which is your reasonable service.
2And be not conformed to this world: but be ye transformed by the renewing of your mind, that ye may prove what
is that good, and acceptable, and perfect, will of God.