In the "standard version" of the Babylonian epic (see the translation by Andrew George, Penguin, 1999), it is not very clear. After the gods discover that Uta-napishti has survived the flood, Ea upbraids Enlil for sending the flood without first talking to the other gods (emphasis mine):
Instead of your causing the Deluge,
a lion could have risen, and diminished the people!
Instead of your causing the Deluge,
a wolf could have risen, and diminished the people!
Instead of your causing the Deluge,
a famine could have happened, and slaughtered the land!
Instead of your causing the Deluge,
the Plague God could have risen, and slaughtered the land!
Apparently, Enlil send the flood to "diminish the people". But this raises another question: Why did Enlil want to "diminish" the people in the first place?
The standard version of the epic keeps silent on this matter, so we need to turn to another Babylonian story, namely the The Epic of Atraḥasis (sometimes spelled Atram-hasis). This story tells us that the gods created man in order to delegate the hard work to them: "Create a human being, that he bear the yoke".
Andrew George writes in the introduction to his Gilgamesh edition (page xliii - xliv):
But the human race had another defect: it bred with great ease and rapidly became too numerous. As the poem of Atram-hasis relates, three times, at intervals of 1,200 years, the god Enlil tired of the relentless hubbub of the new creation, which kept him awake in his chamber. Each time he resolved to reduce the human population, first by plague, then by drought and finally by famine. Each time he was successful at first, so that the number of man were considerably diminished.
In other words, the Deluge is Enlil's final solution to man's "relentless hubbub".