There are people who adhere to their religious principles very nicely and have a lot of knowledge, but they are not kind to all living entities and/or are self-centered. They only think of themselves in all respects, they have no consideration for others. They do very little or nothing for the benefit of others. Such religious following has no meaning. 

“dharmaḥ kvacit tatra na bhūta-sauhṛdam… – Someone may possess full knowledge of religion but still not be kind to all living entities.” (Shrimad-Bhagavatam 8.8.21)

Sanskrit to English Translation

dharmaḥ – religion
kvacit – one may have full knowledge of;
tatra – therein;
na – not;
bhuta-sauhrdam – friendship with other living entities

“One who is not envious but who is a kind friend to all living entities… – he is very dear to Me.” (Lord Krishna, Bhagavad-Gita 12.13-14)
“…who is always busy working for the welfare of all sentient beings – achieves liberation in the Supreme.” (Lord Krishna, Bhagavad-Gita 5.25)
Treating others nicely and using your time, energy, and resources to help others is very important.