What therefore was God’s purpose in (nearly) destroying man (Gen 6:7)?

I think it is fair to say that he was, literally, putting the fear of God into mankind ever after. His act was that of a sovereign exercising absolute prerogative over his own creation. He was, once and for all, establishing the absolute sovereignty of the Lord. This is a thing that God does over and over in the Bible: he demonstrates his sovereignty over one aspect of the creation, and that, typically, fairly early on in the narrative. Other examples include exile of Adam and Eve from the Garden, and of Cain from his presence; of the Tower of Babel, an attempt to raise man to the level of “the gods”; of the thoroughly corrupt but prosperous cities, Sodom and Gomorrah, of the (then) green rift valley east of the Promised Land; of the Egyptians, the first great empire of the Bible; of those who would use pagan idols to worship God, beginning with Rachel; of Nadab and Abihu, destroyed as a sign of his sovereignty over the priestly activities; of the wandering men who refused to trust in God’s guarantee of the Promised Land; later, of the fall of Israel and Judah, showing his sovereignty over the Promised Land when the Hebrews failed to keep up their part of the covenant; ultimately, he will demonstrate once and for all his total sovereignty over all creation at the end of time. So in the case of Noah, he chose to (all but) destroy man in order to clarify to wicked man from nearly the beginning, his sovereignty over his creation: we should not expect to be able to live in such wickedness forever. In the Psalms in two places there are two instances where the image of a flood, or of The Flood, is used to illustrate God’s sovereignty. “The Lord sitteth upon the flood; yea, the Lord sitteth King for ever.” (Ps. 29:10) Little could be clearer than that. But consider also: “Your throne is established from of old; You are from everlasting. The floods have lifted up, O Lord, the floods have lifted up their voice; the floods lift up their waves. The Lord on high is mightier than the noise of many waters, yea, than the mighty waves of the sea.” (Ps 93:3-4)