Post mortem photography was popular in the Victorian era when photography was recently invented because having your picture taken was so expensive. Often families would only have one picture of each person in their family. It was common, especially for children, to have their picture taken after they had died.
Because for photographs back then the subject would have to sit still for several minutes to get a clear shot, having the subjects be dead would be a way to get a sharp image. This is also why you never see people smile in Victorian photographs– it’s easier to sit still with a straight face than hold a smile for several minutes.