An old Indo-European custom. In India it was called suttee, where the wife was expected to ascend the funeral pyre with the husband. The Vikings for a time usually got a slave to accompany the dead chieftain into the afterlife. In Homer, they sacrificed Trojan captives at Patroclus' funeral games.
Ah, the good old days. /s
Although they claim not, they still do that in India.