Grief

Grief is a puzzling phenomenon. It is often costly and prolonged, potentially increasing mortality rates, drug abuse, withdrawal from social life, and susceptibility to illness. These costs cannot be repaid by the deceased and therefore might appear wasted.

Source : Personality and Social Psychology Review (paywalled) Volume: 18 issue: 2, page(s): 168-186

The authors of the above paper suggest that "grief functions as an honest indicator of commitment".

Many other psychologists, philosophers and evolutionary theorists have provided a wide variety of theories to attempt to explain the intensity and persistence of grief. No one theory has been generally accepted.

Given its highly debilitating psychological and physical manifestations which can be very harmful to the individual(s) concerned, it seems to run directly against evolutionary theory. See Wikipedia

Note: Many other animals are known to be susceptible to grief.of one form or another.