(ה) וַיַּרְא יי כִּי רַבָּה רָעַת הָאָדָם בָּאָרֶץ וְכָל־יֵצֶר מַחְשְׁבֹת לִבּוֹ רַק רַע כָּל־הַיּֽוֹם׃ (ו) וַיִּנָּחֶם יי כִּֽי־עָשָׂה אֶת־הָֽאָדָם בָּאָרֶץ וַיִּתְעַצֵּב אֶל־לִבּֽוֹ׃ (ז) וַיֹּאמֶר יי אֶמְחֶה אֶת־הָאָדָם אֲשֶׁר־בָּרָאתִי מֵעַל פְּנֵי הָֽאֲדָמָה מֵֽאָדָם עַד־בְּהֵמָה עַד־רֶמֶשׂ וְעַד־עוֹף הַשָּׁמָיִם כִּי נִחַמְתִּי כִּי עֲשִׂיתִם׃
(5) Adonai saw how great was man's wickedness on earth, and how every plan devised in his heart was nothing but evil all the time. (6) And Adonai regretted that Adonai had made man on earth, and Adonai's heart was saddened. (7) Adonai said, “I will blot out from the earth the men whom I created—men together with beasts, creeping things, and birds of the sky; for I regret that I made them.”
Sforno on Genesis 6:5 (Ovadia ben Jacob Sforno, Italy, 1475-1550)
כי רבה רעת האדם, how great was man's wickedness on earth - a reference to the past;
וכל יצר לב האדם, every plan devised by his mind was nothing but evil all the time - a reference to the future (when it would not improve)
(David Kimhi, France, 1160-1235)
And Adonai saw - God saw that the time God had allocated to the people to improve their ways had elapsed, but nothing had changed. Nothing but evil all the time - רק רע כל היום, the words every plan (וכל יצר) refer to both man’s urges, the urge to do good (yetzer hatov), and the urge to do evil (yetzer ha-ra). The urge to do good had succumbed to the evil urge, completely... When God created the human race, God wanted it to be good completely, or at least predominantly. If humankind would turn to be completely evil it could not endure, seeing that God had chosen the good. When God saw that the generation preceding the deluge was thoroughly evil, especially in their inter-personal relations, their use of violence as a legitimate tool to gain their ends, their deeds threatened to undermine the foundations upon which God had built the universe. God therefore decided to destroy all those who were evil and to save only the few good ones, so that these survivors could form the nucleus of a better human race after the deluge.
(Hezekiah ben Manoah, France, 1250-1310)
[One could posit that] seeing that God has foreknowledge of all that humans will do, creating them had been an exercise in futility to start with; [therefore], why had God bothered? The answer is that everything is under the control of heaven except man’s decision to [either] live in awe of the Creator or to defy the Creator. Seeing that God had decided to create a creature equipped with free will, God had simultaneously abrogated the right to interfere.
(12) And now, O Israel, what does Adonai your God ask of you? Only this: to revere Adonai your God, to walk only in God's paths, to love God, and to serve Adonai your God with all your heart and soul,
(Shlomo Yitzchaki, France, 1040-1105)
וַיִּתְעַצֵּב אֶל־לִבּֽוֹ - And Adonai's heart was saddened — God mourned at the failure of God's handiwork. Similarly (2 Samuel 19:3) "The king grieved (נעצב) for his son." Similarly here: God grieved for God's creation's heart: that it had changed from good to bad.