Fish sleep is best understood as something quite different from sleep in other animals. This short excerpt from the US National Ocean Service sums it up:
The nature of fish "sleep" is an area of active research. While fish do not sleep in the same way that land mammals sleep, most fish do rest.
Research shows that fish may reduce their activity and metabolism while remaining alert to danger. Some fish float in place, some wedge themselves into a secure spot in the mud or coral, and some even locate a suitable nest. These periods of "suspended animation" may perform the same restorative functions as sleep does in people.
Light has a critical role in this, as fish are extremely sensitive to any light. This is why it is essential to provide a period of several hours each "night" when the fish are in total darkness, with no ambient room lighting. Even moonlight can disrupt this. The circadian rhythm in fish is driven by light as it is in other animals including humans.