...and similar to this is an account that is mentioned, that a person came across the statement of the Messenger - صلى الله عليه وآله وسلم:.
“Whoever practices sincerity for Allaah for forty mornings, the springs of wisdom would spring forth from his heart to his tounge.” 
So this person practiced sincerity – according to him – for forty mornings, in order to attain wisdom, so he didn’t attain it. He complained to a wise scholar who told him; ‘You did not practice sincerity for [attaining the pleasure of ] Allaah the Exalted, you only practiced sincerity for attaining wisdom.’
Meaning that sincerity to Allaah the Glorified and Exalted, is seeking His Face, if you attain this you would attain wisdom as a consequence, but if attaining wisdom is what is intended to begin with, then sincerity for Allaah the Glorified would not have taken place, the only thing that took place is the notion that you are practicing sincerity for Allaah the Elevated.
Likewise is the statement of the Messenger - صلى الله عليه وآله وسلم:
”No person would practice humility for Allaah except that Allaah would raise him.” 
So if someone practices humility in order to be raised by Allaah amongst the people, then he is not practicing humility, because his intent is to be raised and that is contradictory to humility.
The source of this article in a treatise on Ikhlaas by Shaykh Farkoos.
 This Hadeeth was declared as inauthentic by al Albaanee in ‘As Silsilah ad Da’eefah’: #38 and ‘Da’eef at Targheeb wat Tarheeb’: #2
 Collected by Muslim 12/141.