I think there was a similar anecdote about Abraham Lincoln and a pig, but from the other direction
The Fable of Abraham Lincoln and the Pigs
Once Lincoln was traveling in a mud-wagon coach along a swampy, rural area. His fellow passenger was his good friend and US Senator Edward Dickinson Baker, who later lost his life in the Battle of Ball’s Bluff at the onset of the American Civil War.
While they were conversing in the mud-wagon coach, Lincoln remarked to Baker that in doing good and evil, all people are motivated by selfishness. Just as Baker challenged Lincoln’s assertion, their coach crossed a rickety bridge over a slough (a large swampy marsh.)
Abruptly, Lincoln and Baker glimpsed a mother pig making a terrible squeal because her piglets were stuck in the swamp, couldn’t get out, and were in danger of drowning.
As their coach started to head away, Lincoln yelled, “Driver, can’t you stop just a moment?” The driver replied, “If the other fellow don’t object.”
With Baker’s approval, Lincoln jumped out of the wagon, ran to the slough, lifted the piglets one by one out of the swamp, and carried them to the dry bank of the swamp.
When Lincoln returned to the coach, Baker remarked, “Now, Abe, where does selfishness come in this little episode?”
Lincoln replied, “Why, bless your soul, Ed, that was the very essence of selfishness. I would have had no peace of mind all day had I gone on and left that suffering old sow worrying over those pigs. I did it to get peace of mind, don’t you see?”
anyway I think the idea that good needs to be externally motivated and that the giver isn’t allowed to benefit from it, even inside their own head, is extremely puritanical and nature and can be discarded