"Then God blessed Noah and his sons saying to them, "Be fruitful and increase in number and fill the Earth, the fear and dread of you will fall on all beasts of the earth, and on the birds of the sky, on every creature that moves along the ground and on all the fish of the sea; they are all given to you
"I know establish a covenant with you and your descendants after you and with every living creature that was with you on the Ark. I establish my covenant with you never again will all life be destroyed by a flood; never again will there be a flood to destroy the earth"
"This is the sign of the covenant I am making between me and you and every living creature with you, a covenant for all generations to come: I have set my rainbow in the clouds and it will be the sign of the covenant between me and the Earth
"Never again will the waters become a flood and destroy all life. Whenever the rainbow appears in the clouds, I will remember the everlasting covenant between God and all living creatures of every kind on Earth."
The life lesson of this story is that not everybody is perfect. As you can see in this story god flooded the earth so he could wash away everybody's sins. He ends up regretting it due to the loss life that god created and said that It was good.