Well, it's better to do good actions even if the intention may be to receive benefits back from it rather than not do any good actions at all. This is often confusing for some people. They see that they are rewarded for doing good actions and then they think they are selfish for doing them. But actually this is just the natural Law of Cause and Effect, because the beneficial actions produces beneficial results to you.
Certainly I believe it would be more skillful to have a compassionate intention behind doing actions rather than just doing them to receive something in return. However I do believe there's some compassionate intention towards oneself to doing good so we can protect ourselves. Doing good deeds usually does benefit others, so helping oneself helps others. This is important especially in the Western mind, how helping oneself actually does help others. This is not just my opinion, it is a quote from the scriptures from the Buddha "by helping oneself, one helps others."
If we work on ourselves and understand the causes of suffering and let them go within ourselves, then there's one less person in the world whom we have to help, who needs help. If more people were able to do this, then there wouldn't be so many people in need of help. And if a person does good deeds in order to enhance their own merit, then they are actually being unselfish towards the person they will become. They have some right understanding that everything they think, say and do will have a result. So there's more Right View in that rather than not doing good deeds at all. And they do have some compassion for at least one person. The person they are going to become.