Because no mission required it and there was nothing underwater to explore. I felt diving in San Andreas was pretty pointless and it's only use really was to build up lung capacity so you could do missions that required it. I think there may have been a few hidden items in the ocean but that's about it.
They probably decided to not bother with it. If they didn't add the ability to swim underwater, it mean't that they did not have to bother to design anything underwater like water effects and props underwater. Not only does that save times and resources for them to work on other things but it also leaves less stress on the older consoles (the Xbox 360 and the PlayStation 3). Obviously, we now have a pretty good underwater experience with GTA 5 because the consoles can handle it alongside a beautiful world.
Consistently one of my biggest questions and frustrations with the game, and it really does seem like every time I just forget and try it anyways, only to get frustrated again. It is just on me at this point, but still I would like to see it.
I think the game scenario being fixated on racing. I guess this could be one reason that it is not much into underwater and space stuff.
It was not coded into the game for whatever reason - ask Rockstar why they didn't. I suspect they were rushing to release the game and "cut corners" in some areas of production. A perfect example of this is the inability to exercise and grow stronger like in San Andreas among other things.
I guess the developers and publishers find no need for the underwater swimming. Maybe there aren't any missions that require underwater exploration like those found on Grand Theft Auto 5. It could also be that they don't have the time or resources to design the underwater assets because that would also take a lot of time.
The issue with your comment is that they did have underwater swimming in San Andreas but rushed the release of GTA IV that they didn't bother to add it.
I'm surprised we didn't have underwater swimming like in San Andreas, in terms of features IV is superior, but for some reason no underwater swimming. I'm sure you can get it with a mod or so.