the flood was sent to rid the earth of the sin that had increased - the heart of man being desperately wicked.
out of all the earth god could only find 8 people worthy of saving. he could have just wiped out the lot but chose instead 8 people out of what could have been a population of billions.
the rest of the people had plenty of time to get their act together (120 years it took to build the ark) and had any done so they too would have been saved. instead noah was mocked and the rest is history
when god created man he did so knowing that he had to give him a choice. the choice most chose proved and still does prove, to be one of death.
if the people were innocent he would not have flooded the earth. this why he sent a saviour jesus christ