Why did God send the flood when He knew sin would continue after the flood?

This article has been translated into the following languages:

عربى Español Indonesia Polski Português සිංහල