To all those who criticized my comment, I would point out that the military code also specifies that the first job of a soldier is to stay alive so he can do his job. Suicide is not heroic. Or to paraphrase General Patton, "You don't win a war by dying for your country. You win a war by making the other poor bastard die for his." Surrendering your own life out of loyalty to a friend or comrade is stupid as well as a dereliction of duty. And if you could ask the friend's opinion before he died, I'm sure he would have said the same thing.
We are all taught to monitor our gas supply. And to surface when it gets low. If this was a situation outside the military where 2 buddies went diving and the second one died because he wouldn't leave the first one and chose to run out of gas himself, I don't thing anyone would be calling it heroic. The fact that the second victim wore a uniform does not alter the fact that his actions were a stupid mistake.