Are we morally obligated to fulfil the wishes of a deceased person, and if so, why?
I had a long discussion with a friend about this, who is an archaeologist and deeply uncomfortable with the way graves, human remains and the things that got buried with them get treated in archaeology.
I suggested that the moral obligation towards a dead person's wishes mainly stems from wanting to be treated the same after death, thus having to create a society in which deceased people's wishes get respected. Also it would be morally wrong towards the relatives of the deceased to not respect the person's wishes. This would make it easier to explain why we feel more comfortable digging up people that have passed away long ago, since none of their relatives or even people of their culture are still alive.
My friend disagreed and said that this obligation to respect how someone wanted to be buried has nothing to do with those who are still alive. So according to them you can very much do something wrong towards someone who is no longer alive.
I suggested this thought experiment: If you were one of two people remaining on earth, everyone else was dead. Would it actually be morally wrong not to bury the other person in the way they wished, if they pass?
We weren't able to agree on this topic and I am sure much has been said about it in philosophy, so I came to ask here, what are the stances on this topic in philosophy? Where does our moral obligation towards dead people arise from?