Particulates + surfactants during rinse = foam. Check filtration system or drain & recharge the rinse water system as necessary. The particulates may come from various sources, but excess solder flux being rinsed off the boards is a prime culprit. Bacteria in the water can cause foaming. Have a water sample analyzed.