All animals have to maintain a fairly constant body temperature or their body functions can be seriously disturbed. For terrestrial animals the ability to maintain a constant internal body temperature is important because of the large fluctuations in ambient temperature that can occur. Despite constant changes in environmental temperature, most animals maintain a constant body temperature by consuming relatively large amounts of food and oxygen. Digestion and respiration produce energy and large amounts of heat to maintain a constant body temperature. The situation is different in an aquatic environment.
Water has a high resistance to temperature changes so they occur slowly.
So, fish are able to maintain a fairly constant body temperature without expending a lot of energy - which is just as well because oxygen and food are not so readily available. Hopefully, we can now see that being ectothermic is not due to a lack of evolutionary development but is a necessary adaptation to a specific environment, in this case water. Fish make efficient use of meagre levels of available oxygen and thereby obtain sufficient oxygen to lead active lives. As we all know, fish breathe through their gills. Their large surface area and counter-current blood flow enables gills to extract up to 80 per cent of the available oxygen.