Sexual dimorphism for the purpose of intraspecific combat or mate quality recognition
Sexually dimorphic headgear is extremely, extremely common in the animal kingdom, ranging from insects to fishes to iguanas to Shringasaurus to proto-mammals to ungulates. Many species of ungulates, in particular, have very elaborate head ornaments in the males but much less noticeable or absent ones in females. Antlers or horns are the commonly thought of examples but many ungulates will have bony growths of some kind. Brontotheres, protoceratids, and giraffes have skin-covered bony growths known as ossicones, entelodonts have bony flanges on their skull, and warthogs and some oreodonts have well-developed bony "warts". In all of these cases the growths of males are much larger and more extreme looking than in the females. Indeed, in some cases (the protoceratid Protoceras or the modern okapi, for example) males have ossicones and females don't. Hercules or rhinoceros beetles are another good example. The males have extremely elaborate head shapes they use for intraspecific combat, whereas the females lack headgear.
In a lot of these cases this headgear evolves for the purposes of male-male combat. Headbutting, locking antlers, etc. In your case I would expect head-butting to be the primary driving factor, especially as real hammerheads use their heads to pin down stingrays on the sea floor so they can eat them. Whacking each other and trying to pin a rival male with your head isn't too different from what real animals do (headbutting between males is pretty common in a variety of species), and it would result in positive sexual selection on the hammerhead (males with biggest heads are more likely to reproduce).
The other thing this kind of sexual dimorphism does is it advertises mate quality, since a large hammerhead takes a lot of nutrients to grow and thus cannot be easily faked. This has two purposes: it frightens off smaller rivals who don't want to pick a fight with a male with a huge hammer (and thus kind of ties into the whole intraspecific combat thing), and it shows to females that the male is healthy enough to afford to grow a gigantic hammerhead. This is what you see with things like deer antlers.
The condition you show here actually occurs to some degree in the stalk-eyed flies. Both genders have hammerheads, but the males have much longer and wider stalks. The length of the eyestalk is thought to advertise mate quality because they are such a handicap to survival, like peacock tail feathers.