Fish had no need for a neck, until they left the ocean
Even if you’ve got a great backstroke or amazing butterfly, you’re always up against anatomical drawbacks human bodies face as swimmers. There are obvious issues, like needing to breath or how little our limbs resemble paddles, but even the way our heads sit on our bodies is a problem. Having a neck is really a terrestrial concept which generally hinders more than helps when trying to move quickly through the ocean. This is why fish never bothered with them in the first place, leaving necks to be invented only when vertebrates finally considered leaving the water.
Fast but not flexible
Most fish are roughly shaped like torpedoes, allowing them to efficiently move forward through the water when driven by their tails. This is usually accomplished in a lateral motion, moving the whole body to a certain degree as they push against the water. Their heads are kept inline with their bodies through shoulder girdles, which are analogous to our clavicles and scapula. A true neck would allow the fish’s head to rock back and forth, requiring muscular effort to keep them looking forward against the lateral motion of their tails and bodies.
While efficient and hydrodynamic, lobe-finned fish started breaking with this rigid formula over 375 million years ago. A mild change can be seen in fish like the coelacanth, but the real shift in anatomy is clear in Tiktaalik roseae. T. roseae is considered one of the bridge species between the oceans and the land, with thick fins that kicked off millions of years of tetrapod evolution. In addition to thick fins that could act as crude legs, this creature’s spine included neck joints, which would have allowed it to peak above the surface of the water or snap its head quickly at prey, all made easier when the leg-fins could brace the body against these movements.
While necks obviously became quite popular since then, species that have later returned to the oceans have demonstrated how they’re just not a match for fully aquatic lifestyles. Various reptiles moved back to the oceans, some sporting long necks, but they likely moved by paddling with their front flippers, not pushing with their tails. Whales and dolphins committed more fully to being fast swimmers, and as they now move based on tail movement, their necks have evolved to be much more fish-like. While they still have neck vertebrae, those bones are now short and rigid, allowing these former land-lovers to really cruise through the ocean without something as pesky as their heads getting in the way.
Source: Why Don't Fish Have Necks? by Laura Geggel, Live Science