Imam Khomeini through his famous works "the combnat" with the self regard with the topic explains as following:
Those who have constructed [their own] religions, causing the straying and deviation of masses of peoples, have for the most part been scholars. Some of them even studied and disciplined themselves in the centers of learning The head of one of the heretical sects studied in these very seminaries of ours.
However, since his learning was not accompanied by refinement and purification, since he did not advance on the path toward God, and since he did not remove the pollution from himself, he bore the fruit of ignominy. If man does not cast pollution from the core of his soul, not only will whatever studying and learning he does be of no benefit by itself, rather it will actually be harmful.
When evil enters knowledge in this center, the product will be evil, root and branch, an evil tree. However much these concepts are accumulated in a black impure heart that which covers them will be greater. In a soul which is unrefined, knowledge is a dark cover: Al-‘ilm huwa al-hijab al-akbar (Knowledge is the greatest cover). Therefore, the vice of a corrupt ‘alim is greater and more dangerous for Islam than all vices.
Knowledge is light, but in a black corrupt heart it spreads wide the skirts of darkness and blackness. A knowledge which would draw man closer to God, in a worldly soul brings him far distant from the place of the Almighty.
Even the knowledge of divine unity (tawhid), if it is for anything other than God, it becomes a cover of darkness, for it is a preoccupation with that which is other than God, Imam further explained.
If one memorizes and recites the Noble Qur’an in all fourteen different canonical methods of recital, if it is for anything other than God, it will not bring him anything but covering and distance from Haqq Ta‘ala (God). If you study, and go to some trouble, you may become an ‘alim, but you had better know that there is a big difference between being an ‘alim and being refined.
Read more: