Flies were created solely for the purpose of annoying you!
Then again..... maybe they are an integrate part of evolution so that you are not subjected to a myriad of diseases generated by putrefying flesh from animals that have crawled away to die and are not accessible to the usual scavengers.
It is us humans that generate so much organic rubbish which in turn has promoted the present vast fly population.