Usefulness is only a tendency to a certain end; and it is a contradiction in terms, that anything pleases as means to an end, where the end itself no wise affects us.
 David Hume, An Enquiry Concerning the Principles of Morals (1751). copy citation

Context

“Compelled by these instances, we must renounce the theory, which accounts for every moral sentiment by the principle of self-love. We must adopt a more public affection, and allow, that the interests of society are not, even on their own account, entirely indifferent to us. Usefulness is only a tendency to a certain end; and it is a contradiction in terms, that anything pleases as means to an end, where the end itself no wise affects us. If usefulness, therefore, be a source of moral sentiment, and if this usefulness be not always considered with a reference to self; it follows, that everything, which contributes to the happiness of society, recommends itself directly to our approbation and good-will.” source