(ט) אֵ֚לֶּה תּוֹלְדֹ֣ת נֹ֔חַ נֹ֗חַ אִ֥ישׁ צַדִּ֛יק תָּמִ֥ים הָיָ֖ה בְּדֹֽרֹתָ֑יו אֶת־הָֽאֱלֹקִ֖ים הִֽתְהַלֶּךְ־נֹֽחַ׃ (י) וַיּ֥וֹלֶד נֹ֖חַ שְׁלֹשָׁ֣ה בָנִ֑ים אֶת־שֵׁ֖ם אֶת־חָ֥ם וְאֶת־יָֽפֶת׃
(9) This is the legacy of Noah.—Noah was a pure and righteous man in his generations, and Noah walked with God.— (10) Noah begot three sons: Shem, Ham, and Yaphet.
בדרותיו. יֵשׁ מֵרַבּוֹתֵינוּ דּוֹרְשִׁים אוֹתוֹ לְשֶׁבַח, כָּל שֶׁכֵּן אִלּוּ הָיָה בְדוֹר צַדִּיקִים הָיָה צַדִּיק יוֹתֵר; וְיֵשׁ שֶׁדּוֹרְשִׁים אוֹתוֹ לִגְנַאי, לְפִי דוֹרוֹ הָיָה צַדִּיק וְאִלּוּ הָיָה בְדוֹרוֹ שֶׁל אַבְרָהָם לֹא הָיָה נֶחְשָׁב לִכְלוּם (סנה' ק"ח):
בדורותיו IN HIS GENERATIONS —
Some of our Rabbis explain this to his credit: he was righteous even in his generation; it follows that had he lived in a generation of righteous people he would have been even more righteous. Others, however, explain it to his discredit: in comparison with his own generation he was accounted righteous, but had he lived in the generation of Abraham he would have been accounted as of no importance (cf. Sanhedrin 108a).
How do we know that [sex] was forbidden [on the Ark]? — From the verse (in Genesis 6:18), “And you shall come into the ark, you and your sons, and your wife and your sons wives with you,” while further on (in Genesis 8:16) it is written, “Go forth from the ark, you and your wife, and your sons and your sons’ wives with you.”
(16) “Go forth from the ark, you and your wife, and your sons and your sons’ wives with you. (17) Bring out with you every living thing of all flesh that is with you: birds, animals, and everything that creeps on earth; and let them swarm on the earth and be fertile and increase on earth.” (18) So Noah went forth, together with his sons, his wife, and his sons’ wives.
ומה שנאמר גם ביציאה, ויצא נח ובניו ואשתו ונשי בניו אע״פ שהתיר הקב״ה לנח המשגל מ״מ לא קבל עליו כי אמר פן יוסיפו לחטוא ויבואו מי המבול וישטפום ולמה זה יוליד לריק ולבהלה
It says again, in the emergence from the ark, that “Noah went forth, together with his sons, his wife, and his sons’ wives,” even though the Holy Blessed One had permitted Noah to have intercourse again. Nevertheless, he would not accept it, for he said, “Perhaps they will continue to sin, and the waters of the flood will come and wash them away. And why should one give birth into this emptiness and chaos?”
(1) God blessed Noah and his sons, and said to them, “Be fruitful and multiply, and fill the earth. (2) The fear and the dread of you shall be upon all the beasts of the earth and upon all the birds of the sky—everything with which the earth is astir—and upon all the fish of the sea; they are given into your hand. (3) Every creature that lives shall be yours to eat; as with the green grasses, I give you all these. (4) You must not, however, eat flesh with its life-blood in it. (5) But for your own life-blood I will require a reckoning: I will require it of every beast; of humanity, too, will I require a reckoning for human life, of every human for that of their fellow human! (6) Whoever sheds the blood of a person, that person's blood be shed; For in God's image Did God make the person. (7) So you, be fruitful and multiply; abound on the earth and increase on it.”