Your question is quite broad and asks for explanations for various behaviours which can lead to self-sacrifice. 

Religious reasons: The genetic influence here may be a predisposition to let others influence you. This is what gives rise to culture in the first place, in other words: the predisposition to at some point maybe sacrifice yourself because you are taught to do so can only die out if the basic behaviour which gives rise to culture dies out. Cultures which lead their members to die may decimate their own numbers, but they will not wipe out culture itself because in the bigger scale, those with culture do better than those without. (Plus, those who sacrifice themselves may have children as well, so any genetic influence on their behaviour can be carried on.) This also goes far into the field of memetic evolution, which is disputed but may be interesting to read about.

Political reasons: As in, dying for one's nation or country rather than because of teachings. This probably has a defensive behaviour towards one's own group as the genetic influence. Also, reputation plays a big role: see shigeta's excellent answer.

You also mention willingness to subordinate oneself which is a very common pattern not only in humans. Richard Dawkins touches on this in The Selfish Gene, but there are probably papers more focussed on this particular topic out there as well.

I think it is far-fetched to assume a genetic inheritance of in general "willingness to die for something" (which would be required for genetic evolution to work on it). Each thing that some people may be willing to die for can have completely different reasons. I think in these terms the willingness to die is usually an exaggeration of a behaviour which evolved for different reasons.

Does becoming martyr have an evolutionary advantage?
How can I typeset the following symbol for beep in multimeter?
