Apparent knowledge in itself is a weapon. Ilm creates arrogance and without the necessary tools is extremely dangerous. Ilm is only beneficial when it comes accompanied with adab, spirituality and fear of Allāh. Rasūl Allāh ﷺ used to supplicate “O Allāh, I seek refuge (and protection) in You from ilm which does not benefit” [Reported by Muslim and others].
Students of knowledge and ulamā are at greater risk of insincerity and impurity in intention/motive than others. Ilm is powerful and attractive and can offer that which the nafs desires. The nafs does not crave things of this lowly worldly life. Rather, when the ruh gets corrupt it craves something celestial (because its origin is celestial). It craves ibadah and worship.
Students of knowledge and scholars may not commit sins of the flesh but there is a danger that they are committing subtle shirk.
[This excerpt is based on a talk delivered by Shaykh Riyadh ul Haq on 31st August 2018].