The baby reference was added by you and is not part of scripture. Of course, there were ungodly people in the world, hence the flood. The bible does not state that babies were ungodly.
God knitted these babies in the womb of the mother. Was this an ungodly act of God? I hardly think so. Your perspective in this regard is warped and twisted.