Oddly enough this topic occurred to while beginning the first chapter of the book THE GREEKS AND GREEK LOVE: A Bold New Exploration of the Ancient World by James Davidson.
It gives a rebuttal to previous works suggesting that male homosexuality among ancient Greeks was purely for sexual fulfilment and nothing more. But why does it commonly occur in cases where men face death?
It seems to me that it must have had an evolutionary benefit to continue to be such a universal practice to this day. And Davidson's book begins to present a logical description of that benefit.
An important existential benefit of male-bonding for the Greeks was to commit men to each other during war. But long before that it would have committed them to each other during the hunt - where there would less likely have been female companionship due to the physical nature of the hunt, and the physical differences in strength between men and women. Also involving women in the hunt would have endangered survival of the group by exposing the only member of the family capable of carrying future offspring.
Facing potentially deadly situations is not likely to disappear anytime soon as a motivation for male-bonding. The group accomplishes more than the individual can possibly accomplish alone. Homophobia may actually be discouraging a survival trait that has allowed the human race to meet overwhelming change.