I'm not a marine biologist, but here's my assumption;
1) Coral reefs are bright and colorful. Fish that live on coral reefs are 'camouflaged' into that environment.
2) Fish that don't predominantly live on coral reefs tend to be silver. Silver coloration helps 'disguise' the fish by reflecting light in the water.
3) Some fish and other marine creatures may be toxic if ingested, or possess toxic spines etc. Those creatures often evolve a 'warning' through bright coloration.
4) Many fish will have bright coloration for species identification, primarily for breeding purposes. Again, that's not necessarily detrimental given the surrounding colors of the reef
5) Because of light behaves differently underwater, and predators may not see within the same light spectrum as humans, it's feasible that the coloration evolved to effectively camouflage the fish to their natural predators - even though they may seem bright and obvious to us (humans).
6) Many fish have broken coloration - breaking up their outlines/body shapes. Some have 'false' features that may disorientate a predator. Examples of this are 'false eyes' on the tails etc.