The glitch causes dead fish to float over the water when they are attacked by an explosive weapon, such as grenades and a rocket launcher. This glitch is most likely a leftover code that was designed to enable dead fish to float to the surface, as they would in real life, but the vertical movement exceeds the surface of the water.
It is only possible to encounter this glitch on the PS2 version of GTA San Andreas. It is likely Rockstar either did not notice or did not have time to rectify the glitch before the PlayStation 2 release deadline.
There are two broad and logical explanations as to why the glitch may exist. Either the fish's floating animation height is incorrectly calculated and they simply float too high, or the global water level was once higher and the fish's floating height is dependent on the previous water level. If the latter is the case, Rockstar likely implemented the floating dead fish animation very early in development, long before lots of objects were added water-side and land was sculpted around the current water level.