Legend has it that The emperor Ashoka once asked a Buddhist monk how much merit and good karma would he earn if he built many temples and undertook countless acts of charity.
The monk replied: None.
The Buddha said “above all loving kindness” . From that I concluded that compassion is the mother of all virtue. Of course there’s a catch; such a guiding principle needs to be without thought, without self. Another conclusion: the good man does good for its own sake, instinctively, not for the sake of ego gratification or the hope of reward.
Seems to me that the atheist trying to be a good person has at least one up on believers in say any of the Abrahamic faiths. Those folks strive to be good to avoid the punishment of hell or to gain the reward of heaven. Indeed, some we have had here seem to relish the idea of atheists going to hell.
IMO just as the only criteria for charity is need, so too the right reason for charity/kindness/compassion is for its own sake.
The foregoing is simply my opinion, which forms part of my world view. Suits me as ideals, but I make no truth claims.