Besides the water quality deterioration or bad condition of it, there are other other causes that can lead to the onset of bacterial infections. The main ones are related to damage that occurred to a coral, as the damaged area gets infected and bacterial disease follows. A piece of rock falls on a coral and causes a puncture or damage. Bristle worms gnaw at a coral and cause damage. A fish causes damage in the process of touching a coral, possibly through sharp gill end, or in the case of Tangs, the brushing of their back razor sharp protective modified partial fin against the coral.
Hermit crabs can cause damage.
Small algae eating crabs can do the same, inadvertently but with the same end result. Stone crabs moving around and touching corals or rubbing their claws against them, even if not on purpose. Some shrimp may do the same, even inadvertenly. Detritus that accumulates on corals rots, and if is not removed by current will eventually damage the polyp of a coral to the point where the damaged part can easily become infected. Some sea slugs Wrasse that are not reef compatible present in the aquarium.