Social organisms take care of their dead in a variety of ways. Individuals in a colony can die of disease that if not properly managed can infect the entire colony. This is one reason why humans bury or cremate their dead. Insect colonies will typically remove dead individuals or wall them off from the rest of the colony.
An interesting question is, “How do insects recognize the dead?” Michael Ulyshen and Thomas Shelton address the question of how termites recognize their dead in a recent paper in Naturwissenschaften.*
With their colony of Reticulitermes virginicus termites, they tested the response to dead termites and other dead insects. As expected, the termites deposited sand in blocks of wood that contained dead termites to wall them off from the colony. Interestingly, the termites did not distinguish between types of dead insects. Predatory ants or benign beetles all received the same treatment as dead termites as long as they were dead.
Suspecting that chemicals might be involved, they tested the response to oleic acid, a natural fatty acid that is released when insects and other animals die. The oleic acid stimulated the same wall building behavior. Interestingly the oleic acid had a greater effect when it was placed on an object such as a bead than if it were simply placed on the wood. This suggests that termites “recognize” their dead through a combination of chemical and contact cues. This innate behavior of entombing the dead is the termites way of giving their dead nest mates a decent burial.*Volume 99, Number 2 (2012), 89-93, DOI: 10.1007/s00114-011-0871-3

I wonder if oleic acid is the stimulant for all insects, or if there are some exceptions.
There are some interesting experiments that could be done.