A famous story is told about Thomas Hobbes, the 17th-century English philosopher, who argued that we all act in our own interests. On seeing him give alms to a beggar, a cleric asked Hobbes if he would have done this if Christ had not commanded us to do so. Yes, Hobbes replied, he was in pain to see the miserable condition of the old man, and his gift, by providing the man with some relief from that misery, also eased Hobbes’s pain. That reply reconciles Hobbes’s charity with his egoistic theory of human motivation, but at the cost of emptying egoism of much of its bite. If egoists suffer when they see a stranger in distress, they are capable of being as charitable as any altruist.
Followers of the 18th-century German philosopher Immanuel Kant would disagree. They think an act has moral worth only if it is done out of a sense of duty. Doing something merely because you enjoy doing it, or enjoy seeing its consequences, they say, has no moral worth, because if you happened not to enjoy doing it, then you wouldn’t do it, and you are not responsible for your likes and dislikes, whereas you are responsible for your obedience to the demands of duty.
Not to mention both Hobbes and Kant are amongst the most well respected philosophers of the ages.