Thank YOU, not "Him"
It is hard to explain to people that you can feel grateful without feeling grateful TO something, but we would venture to say that an atheist's sense of gratitude is a far more special thing. It comes from a genuine place, not an expectation of a reward or a fear of punishment.
Furthermore, how much does it sully your efforts and consideration when the recipient of your kindness thanks a god, instead of you? Doctors who save a patient's life, coaches who bring out the best in their players, directors who push their actors to their limits… how snubbed must they feel?
It's the same mentality that the devout will use to squelch their own anxiety about natural disasters, the loss of loved ones, or unexplainable events. To misplace gratitude is a subtle variant of praying for a war-torn country to feel as if they've accomplished something. It does nothing to effect the object of their wish, and takes away much of their incentive to do something irl.
Religion is a perpetual quest for comfort; but walking around with the blinders of devotion will ensure that person misses out on what this life, their existence, each moment, is all about.