It's just the same as asking why we have to have oxygen to breathe. Actually fish use to once swim in air. That is until birds were invented. Birds hated fish and drove them into the sea. Fish were not use to the wet conditions of the ocean, but thankfully they evolve quickly. The sad part is after developing gills and the respiratory needed for aquatic living they no longer had the lung capacity to breathe air.
Interestingly enough there is still a type of fish that holds remnants of it's life prior to be driven into the depths by birds. It's called a lungfish! And can breath air for a little bit, using a lung-type organ found in it's body. http://www.omg-facts.com/view//28400
Water contains oxygen as one of its component, which the fish need in order to breathe. This is made possible by the gills, which absorb the oxygen when water passes through them. All fish have them and that is why they need water to live.