Not everything in this world has a direct purpose to benefit the human race, such as honey or pollination. You might just as well ask what purpose people have!
Hornets and wasps are just as much a part of the food chain and the ecosystems in which they live as everything else. However, if you think they should have a purpose to justify their existence, then ponder these facts:
they eat up spare fruit that falls from the trees, they also play a part in pollination of plants, they prey on certain pest species that eat our crops
and they provide a food source for other animals that predate them
I think thats enough to be going on with :)