If they didn't enforce the regulations, and receved a sufficient amount of bad marks on it's heath inspections, the government can and will shut the ship down.
That's the last thing a cruise company wants, it'll force them to cancel a cruise, and depending upon the ship's next cruise, up to 2400 very angry passengers.
It has happen in the past and probably will again. Of course, if babies swiming in the pool was the only demerit, the ship will probably pass the inspection. But a ship that's lax on one regulation, is probably lax on many.
I was on the Sun early last month, and the head chef reported passing 4 health and safety inspections last year with almost perfect scores. I don't think he would have been as happy if babies in the swiming pool was a demerit.