Fearing death doesn't mean being afraid of death. It's good to have a healthy respect, or fear of certain things. As I understood what Mr. Laser Beams meant, nobody wants to die and, unless we're suffering from some overwhelming physical or mental incapacity, we all do our best to preserve our lives. Nobody wants to die.
On the other hand, what the OP is missing is that these are HEROES. Heroes act HEROICALLY. In the face of danger, our beloved heroes will glad risk and sacrifice their lives if it means the preservation of others. "The needs of the many outweigh the needs of the few, or the one."
Those brave men that fought the hijackers on Flight 93 on Sept. 11 didn't want to die. Yet they heroically gave their lives so that the evil plans of madmen would be thwarted. Policemen and firefighters do everything they can to protect their lives in the face of danger, yet they gladly and willingly sacrifice their lives if it means saving innocents from harm.
In all the above cited Star Trek episodes, we see friends who would gladly give their lives in exchange for the salvation of their friends.
"No one has love greater than this, that someone should surrender his soul in behalf of his friends."