We are all ultimately hedonists - As sentient beings our actions in life are directed towards the goal of bringing about pleasure(physical and mental) and minimizing pain. This not only insures our surivival but also the survivial of society.
We are driven to eat, sleep, and procreate by this drive within us. Even our mental activites and instituions such as scientific inquiry are driven by this hedonist desire. The individual is motivated to understand the world as it brings about an inner positive mental experience that satiates curiosity. Lack of understanding brings about anxiety and continued discomfort.
The religious believer finds a positive mental experience in the comfort and security of belief. The believer is driven to satiate the desire of the deity in order to bring about the ultimate goal of eternal pleasure and avoid eternal suffering.
Along these lines we do good to others because not to do so would bring about a negative mental experience in most individuals- guilt, shame, sadness. We have empathy and can associate with the plight of fellow beings. To ignore the plight leads to guilt.
On the other side of the coin most of us(outside sociopaths) do not intentionlly bring about pain and suffering on others. The result would be negative -shame, intense guilt, self loathing. Most of us therefore avoid these activities.