There's no one reason rnch. There can be several.
To mitigate what some think of as the grim finality of death.
To follow an old axiom to not speak ill of the dead.
To show that their contributions outweighed their failings.
Very important: compassion for the ones experiencing loss, and as we wrote in another topic, the keen and agonizing blade of sudden loss.
The mechanism of nostalgia.
...and there are likely more.