Fish biology is vastly different than that of land creatures you know.
You see, fish have gills instead of lungs like we have. The gills respire with the fresh oxygen particles in the water. when taken out of the water, they are exposed to atmospheric oxygen, and depending on the environment, cant be either toxic, or contain other gases in the atmosphere that are not good for fish, or other times, there is not enough oxygen for the fish to respire with. Every molecule that goes through fish gills contains oxygen. And since they are always in water, not only have they evolved to breathe underwater that way, but the oxygen is at a constant state comprised in the liquid, rather than oxygen flowing freely in the air where its harder to perform respiration with. Don't forget, Liquid molecules flow freely, while gas molecules flow absouluty everywhere and are very far apart from one another. The air is a mixture of many gases rather than just a constant supply of oxygen the fish can use
It is pretty confusing, but thats the best way i can summarize the reasoning behind it.
In humans and many other species, water and salt regulation must be at a constant balance. Too much salt, and u could get dehydrated and potentially die, and believe it or not, too much water and actually kill you as well. So its a bad idea to drink ocean water. It contains high amounts of salt that is too great for our bodies to process, and we become even more dehydrated from it. Plus, there is also tons of bacteria, and minerals that pollute the ocean, so that can also make you pretty sick. If you are gonna drink water, make sure its fresh, from a lake or a stream, and make sure you boil it. Bacteria can not survive high temperatures, so they will die. allowing the water to be safer for consumption.