Shaykhul-Islam Ibn Taymiyyah (may Allah have mercy upon him) stated:
There are many from the students of knowledge whose intention with the knowledge is nothing except the attainment of leadership or wealth, and for every person is that which he intended. As for the people of knowledge and religion, they are the (true) people of knowledge, this is what's intended with them due to its benefit for them and their need for it in this life as well as in the hereafter. Just as Mu'aadh ibn Jabal stated regarding the description of knowledge:
Indeed the seeking of it for the sake of Allah is worship. Reviewing it is a means glorifying (of Allah). The research of it is striving (for the sake of Allah). Teaching it to the one who doesn't know it is a charity. By way of it Allah is known and they worship him. Also (by way of it) Allah is magnified and singled out (for all that which is specifically for Him).Based upon this we find the people who benefit from it, their souls are purified by way of it. They intend with it the following of the truth and not the following of the desires. The traverse on it the path of justice and fairness. They love it and find delight with it. They love an abundance of it and an abundance of its people. Their resolution to act in accordance to it, its mandate and that which it requires is revitalized in contrast to the one who hasn't tasted its sweetness and his intention is nothing except for (the attainment of) wealth or leadership. Indeed if there was another way for him to attain it he would traverse upon it and he would possibly give precedence to it (over the path of seeking knowledge) if it was easier upon him.