If you're really interested in the evolutionary reasons, you might want to take a look at this paper:
A Mathematical Model of Evolutionary Pressures Regulating SelfāPreservation and SelfāDestruction / Suicide and Life-Threatening Behavior, 1986
In short, the theory is that longevity, survival, and self-preservation are
not the primary goal of a living organism.
The primary goal is reproduction. If an organism's reproductive value is zero, or close to zero, survival in itself has no purpose.
Most of the comments here, and most people in general, try to look at suicide from the perspective of the individual, like self-preservation, the amount of pain the individual can endure, etc. But from an evolutionary perspective, and in terms of the survival of the species, these are secondary. The primary objective is the survival of the species. Survival of the individual and self-preservation are useful only as long as it aids reproduction and the creation of new generations.
Where it gets interesting is when we also start to consider family relationships. At the end of the day, survival of the species = survival of the genes and certain traits encoded in those genes. Close family members share a large portion of their genes. So if I can help a family member survive, that also means some of my genes survive too, since our genes are highly similar. This is why helping and supporting a close family member is a very strong motivator to carry on and survive. The closer the relationship, the stronger the motivation. E.g. parents fight to survive so that they can support their children. Siblings support their nieces and nephews, etc. On the other hand, if the individual has no close family relationships and their reproductive value is zero, there is no reason for them to live anymore.
The paper even has a mathematical formula for the whole thing (click to enlarge):
View attachment 207712
This is also why hopelessness, burdensomeness, or social rejection can trigger suicidal behaviour. To put it bluntly, if I'm not going to have kids, and I'm a burden to my family, then the species is better off if I'm dead. I'm doing others a favour by killing myself. Well, that isn't how most suicidal people feel, but from an evolutionary perspective, that's what nature is trying to say.
This is just a simplified version of the whole idea, of course. The paper is much more detailed.
I think the 9/11 jumpers were trying to escape from the flames, not from the potential collapse of the building. They weren't committing suicide. By jumping, they had a higher chance of survival than being burned alive, and that's why they probably jumped.