Sometimes it happens. Then if it happens again and its the same rat eating babies, they get fed off.
It could be because they didn't have enough food or water. It could be a one time fluke.
I keep my rats harem style as 1.3 and move around pregnant females, nursing females, pinks, pups, etc 99% of the time without a problem.
I have had this happen once and the male didn't do it again. I feel high quality rat block which I think has an impact on this not happening.
If it happens again, feed off the culprit. As much as I love my breeders, I personally don't have time to babysit rats. If you only keep the rats who don't have problems being shuffled from bin to bin and will take ANY baby dropped in their nest, you shouldn't have problems like this in the future.