It doesn't. It's hard to imagine, however, how you shoot yourself in the head underwater.
Climbing in or out of the boat with a loaded gun?
Sticking loaded gun under your arm while using hands to handle a fish?
Perhaps passing a loaded gun up/down to buddy in the boat and passing it butt end first?
Don't know about spear guns but used to do some land based hunting and more than one hunter has shot themselves. It almost always is not being safe with a loaded gun.
"
Texas man accidentally shoots himself in jaw trying to kill armadillo
"