In 'Pilgrim at Tinker Creek', author Annie Dillard [b. April 30, 1945] writes of understanding the meaning of life upon learning the 'why' of insects. Basically, though, insect jobs appear to range from support for the worldwide food web to participation in scientific research. Within that web, insects take on important roles as prey, predators and pollinators.
Particularly as prey, they're important sources of protein. As an example, they provide otherwise unavailable protein to such carnivorous plants as the Purple Pitcher [Sarracenia purpurea]. Be they digested as prey, or dead and decaying by other means, insects become equally important sources of nutrient rich organic matter in soil. So digested or otherwise, their body parts contribute to the health of the soil and the well being of its plants and soil food web members.
Additionally, insects are means by which important scientific breakthroughs are achieved. For example, the fruit fly [Tephritidae and Drosophilidae families] is a cooperative, popular research tool for many scientists.
Discovering what insects are for is actually finding the truth of existence. Nobody really knows why they are here or why we are sharing the earth with them. But if you dig deeper into finding the answer into this question, you'll find out that what you are looking for is actually the meaning of life.