If we go against Radak's answer suggested by @Dov in the comments, we can suggest that some of the garbage was necessary as an environment for worms and creeping creatures, which provided the food for birds and reptiles. To prove it the gemara Sanhedrin 108b tells the story about feeding a chameleon in the ark:
Rav Ḥana bar Bizna says: Eliezer, servant of Abraham, said to Shem the Great, son of Noah: It is written: “After their kinds, they emerged from the ark,” indicating that the different types of animals were not intermingled while in the ark. Where were you and what did you do to care for them while they were in the ark? Shem said to him: We experienced great suffering in the ark caring for the animals. Where there was a creature that one typically feeds during the day, we fed it during the day, and where there was a creature that one typically feeds at night, we fed it at night. With regard to that chameleon, my father did not know what it eats. One day, my father was sitting and peeling a pomegranate. A worm fell from it and the chameleon ate it. From that point forward my father would knead bran with water, and when it became overrun with worms, the chameleon would eat it.
This is related to the notion of biome in biology.