Noah

As a young boy, Noah witnesses his father, Lamech, killed by a young Tubal-cain. Many years later, an adult Noah is living with his wife Naameh and their sons Shem, Ham, and Japheth. After seeing a flower grow instantly from the ground and being haunted by dreams of a great flood, Noah takes them to visit his grandfather Methuselah.
They encounter a group of people recently killed and adopt the lone survivor, a girl named Ila. Noah and his family are chased by the murderers and seek refuge with the fallen angels known as the "Watchers", confined on Earth as stone golems (nephilim) for helping humans banished from the Garden of Eden. Methuselah gives Noah a seed from Eden and tells Noah that he was chosen for a reason. Returning to his tent that night, Noah plants the seed in the ground. The Watchers arrive the next morning and debate whether they should help Noah until they see water spout from the spot where Noah planted the seed. Once a forest grows instantly, the Watchers agree to help Noah and his family build an ark.
After birds fly to the ark, Tubal-cain arrives with his followers and confronts Noah. Noah defies Tubal-cain and remarks that there is no escape for the line of Cain. Tubal-cain retreats and decides to build weapons to defeat the Watchers and take the ark. As the ark nears completion, animals of various species enter the ark and are put to sleep with incense.
With Ila having become enamored of Shem, Noah goes to a nearby settlement to find wives for Ham and Japheth, but upon witnessing the settlers' exchanging their daughters for food, he abandons his effort and begins believing that the creator wants all of humanity dead. Back at the ark, he tells his family that he will not seek wives for his younger sons. After the flood, they will be the last humans and there will be no new human generations.
Devastated that he will be alone his entire life, Ham runs into the forest. Naameh begs Noah to reconsider but, when he will not, she goes to Methuselah for help. Later, in the forest, Ila encounters Methuselah who cures her infertility. Meanwhile, Ham, searching for a wife on his own, befriends the refugee Na'el.
After it starts raining, Tubal-cain becomes angry that he was not chosen to be saved and incites his followers to make a run for the ark. Noah finds Ham in the forest and forces Ham to save himself, but leaves Na'el to die when she is caught in an animal trap. Noah's family enter the ark except for Methuselah, who remains in the forest and is swept away by the rushing waters. The Watchers hold off Tubal-cain and his followers as long as possible, sacrificing themselves to protect the ark from the mob before ascending to heaven. As the flood drowns the remaining humans, an injured Tubal-cain climbs onto the ark and solicits Ham, playing on anger toward Noah for allowing Na'el to die.
Ila discovers that she is pregnant as the rains stop and begs the creator to let the child live. Noah interprets the ending of the rain to mean he must ensure the extinction of humans and, against his wife's protests, resolves that, if the child is a girl, he will kill her. Months pass, and Ila and Shem build a raft to escape Noah's resolve, but Noah discovers and burns it. Ila then starts feeling labor pains and gives birth to twin girls. In the meantime Ham has called Noah telling him the beasts are awake and eating each other. Tubal-cain emerges and attempts to hit Noah. Noah and Tubal-cain engage in combat. Shem promises Ila that Noah will not harm their daughters and goes to stop him. He attacks Noah as Tubal-cain falls to the ground only to be knocked out. Tubal-cain eventually forces Noah to the edge of the raft, but Ham kills him with a dagger before he can shove Noah in the ocean. Noah picks himself up and immediately goes to find Ila and the babies. He is confronted by his wife who lies and tells him it was a boy but he does not believe her. He goes to find Ila on top of the ark, she cries and tells him to wait to kill them until she can calm them down as she doesn't want them to die crying. Noah prepares to stab Ila's twins, but he spares them upon looking at his granddaughters and only feeling love.
Upon exiting the ark on the new land, a shameful Noah goes into isolation in a nearby cave, making wine in which to drown his sorrows. Ham expresses disappointment for his father's current state of unseemly drunkenness and nakedness before leaving his kin to live alone. Having reconciled at the behest of Ila, Noah blesses the family as the beginning of a new human race and all witness an immense rainbow.

Question: Why did Noah believe he must ensure the extinction of humans?
Answer: The ending of the rain.