Despite the familiar myth of lemmings
throwing themselves off cliffs, this seems to be a rare phenomenon. There are no real clear
answers to this question.
It has been reported that dolphins in captivity have done it (one purportedly battered itself to death and soon after its companion did the same).
Altruism that leads to death among animals is quite common, for instance, common octopi look after their young and fail to feed themselves sometimes to the point of death, and some spiders are devoured by their young.
There are some parasites that seem to cause suicides in their host, in somewhat odd ways, for example the parasite Toxoplasma gondii makes rats become unafraid of cats.. thus, they die. Some bumblebee parasites make the bee dive into ponds.
some help from sciencenet.org.uk