In natural languages such as English almost all words — and all short words — have multiple meanings. These meanings are usually related in some way, but they are all different. Look at any dictionary: you'll see an enumeration of different meanings for almost all words. We automatically and usually subconsciously disambiguate these variant meanings by appealing to the context in which words appear.
Such is the case with a word such as "good". I want to discuss one specific meaning of "good": the meaning of "individual benefit".
The best way to understand our brains is as goal-seeking computers: We are always evaluating our internal and external state and seeking, all things considered and given present circumstances, to perform the optimal action. We may be (and often are) confused or mistaken about what the effects of some action will actually be, but, given our understanding, we always seek what we believe to be the best course of action, the course of action that will result in what we believe will be the best physically possible outcome.
In short, we always do, by definition, what we think will be best, what we think will deliver the most benefit.
This is a definition, but it is not strictly tautological: Our brains might not be goal seeking machines. A computer, for example, can be programmed to be a goal-seeking machine, but there are other ways of programming computers. It's logically possible that we might be sphexish, but it is actually true that we are not.
When judging another person's behavior, motivation or belief, their personal benefit cannot affect my own evaluation because I already know that the action is — to the other person — of maximum physically possible utility. Everyone, from the nicest, most considerate person to the most depraved tyrant, mass murderer or child rapist believes that he or she is not just doing good, but doing what is best. It's pointless to try to make any kind of distinction on something that's absolutely invariant.
(Well, not entirely pointless. We employ this sort of reasoning, when a person behaves very strangely, to conclude that they are actually insane; that the goal-seeking character of their brain has been deeply undermined. But real insanity is relatively rare and not an ethical issue.)
I can't rely on the other person's evaluation of the benefits (since that's always the same: optimal), so I have to rely on (among other things) my own evaluation of the benefits of an action: how it does or would benefit me. (And, since I'm a normal human being capable of abstract reasoning, I evaluate not just the particular benefits, but also the abstract categories the benefits belongs to.)
So, yes, in this sense, religion — like everything else — gives its practitioners what they believe to be maximal benefit. But that's completely irrelevant from an ethical perspective: By this criterion everything is perfectly good; each person lives in the best of all possible worlds.