Flies, unfortunately love chicken poop. Flies in particular love chicken coops because of the abundance of manure, which is their favorite food.
Chickens poop almost constantly, everywhere. It’s practically impossible to keep the coop sparkling clean on a day to day basis.
Flies are always ready to take full advantage of that fact.
One thing you can do to control chicken coop flies is to keep the coop completely clean and dry at all times.
Depending on how many chickens you have, this may mean cleaning out the coop every day, or every few days.
One of the better things you can use (without using pesticides) is: "Diatomaceous Earth".

Sprinkling it in the chicken coop works as a 'dehydrator'.
Sprinkling Diatomameceous earth on chicken coop bedding helps to keep it dry and also dehydrates and kills fly larva on contact.
We sprinkle (food grade DE) in the coop and nesting boxes every time we clean out the coop and have found it to really cut down on the number of flies.

It is also safe for your flock to consume.
You absolutely can mix Diatomaceous Earth into your chickens daily feed. D.E. contains many trace minerals,
but the main component of D.E., silica, gives many benefits to chickens. ... By regularly adding DE to your chicken's diet
(will) help prevent internal worms. "Chicks" on a high-silica diet attain maximal bone re-mineralization faster than those on low-silica diets.
According to a study in Poultry Science, chickens with DE in their diet laid larger eggs containing more albumen,
weighed more, ate more, and had fewer worms. (The ratio is 2% diatomaceous earth in the feed you give them.)