But, though a wise man feels little pleasure from praise where he knows there is no praise-worthiness, he often feels the highest in doing what he knows to be praise-worthy, though he knows equally well that no praise is ever to be bestowed upon it. To obtain the approbation of mankind, where no approbation is due, can never be an object of any importance to him.
 Adam Smith, The Theory of Moral Sentiments (1759). copy citation

Context

“It is only the weakest and most superficial of mankind who can be much delighted with that praise which they themselves know to be altogether unmerited. A weak man may sometimes be pleased with it, but a wise man rejects it upon all occasions. But, though a wise man feels little pleasure from praise where he knows there is no praise-worthiness, he often feels the highest in doing what he knows to be praise-worthy, though he knows equally well that no praise is ever to be bestowed upon it. To obtain the approbation of mankind, where no approbation is due, can never be an object of any importance to him. To obtain that approbation where it is really due, may sometimes be an object of no great importance to him. But to be that thing which deserves approbation, must always be an object of the highest. To desire, or even to accept of praise, where no praise is due, can be the effect only of the most contemptible vanity.” source