God, who knows all, said there must be a male and female in a pair to sustain life.
Read: Genesis 7:3,5
Also take seven pairs of every kind of bird. There must be a male and a female in each pair to ensure that all life will survive on the earth after the flood.
So Noah did everything as the Lord commanded him.