I was talking to a friend the other day about the reasons for, and importance of
Interesting question. Here is just a start of an answer. There are at least two ways in which remembering the dead, and the way they died (as with war memorials, which you mention) might be beneficial for non-selfish reasons, though part of this depends on what counts as "selfish." First, many philosophers think that it is possible to be harmed, and benefited, even once you no longer exist. Imagine that a loving father, who upheld his fatherly duties throughout his life even at great cost, is slandered after he dies. Suppose it is said about him, falsely, that he committed horrendous crimes against his children. Some would argue that this harms him, that it makes his life--which is no temporally over--worse off than it would had the truth come out about his parenting. If that's so, then you might well think that it makes one's life better if one is remembered fondly, or with honor. Imagine you are somehow given a choice of never being remembered or being revered, after your death, as a great human being. I think most people would choose the latter, and one possible reason is that most people recognize that this life, even once it is over, is better off if it is remembered in the right way. I heard a philosopher, David Boonan, give a talk on this topic once, and you might look him up to see if he has it written. Secondly, remembering, and especially officially memorializing, the dead, not only honors them but potentially teaches the living about their lives. Remember victims of WW1 can serve as a deterrent to future wars, and provides opportunities to reflect on our own, relatively privileged or comfortable lives. This may be "selfish" in the sense that it does not directly affect those who died. But it is not selfish in the ordinary sense of the term. That is, you do not merely or only benefit yourself when you remember the dead in such circumstances: you benefit those around you, and future generations, by increasing awareness of, and hopefully decreasing chances are, similar deaths in the future.
Those are just two reasons to remember the dead. I can imagine others. But I'll leave it to the experts (which I am not) in the field to chime in.
Thanks for an interesting question!