When Noach is first approached by G-d, it is explained to him, why it was necessary to destroy the world.
Noach is told קץ כל בשר בא לפני, “The end of all flesh has come before Me.” The choice of using the word, קץ, is significant. The Keli Yakar says that really the word, קץ, does not mean, “the end,” but it is referring to the יום המיתה, the day of death.
In other words, the literal translation would be that Hashem is telling Noach, that the day of death is coming to all living things. Even the animals became corrupt, and mated with other animals, not of their species.
The lesson that the Keli Yakar is teaching, is that most sin comes because the transgressor, forgets about his own יום המיתה. He removes from his thought process, the inevitability of his own day of death.
Although we are not supposed to be obsessed with death, we are also not to pretend that it does not exist. If one remembers that he is placed on this earth for a limited time, he might also realize that there will be a day of reckoning, where he will be held accountable for his transgressions.
It is the people that believe that they will live forever, who go about life in a reckless manner. They forget about a Day of Judgement, that will come.
The Noach story is a reminder that we need to get our priorities straight. It is our task to work on ourselves, and constantly try to elevate ourselves. Not only will this give us meaning and purpose, but it will allow us to stand proudly before G-d, because we know we did our best.