The dead flies stuck to twigs, vines and other garden plants are most likely seedcorn maggot flies or Delia platura. The larvae of these flies damage vegetables but not flowers, trees or vines.
Seedcorn maggot flies are grayish with red eyes and only around 1/5 inch long. Dead seedcorn flies stuck to plants often have pink stripes around their abdomens.
Those pink stripes on the dead flies are the reason why the flies died. They are the spores of entomophthora fungus. The fungus seems to interfere with the flies' coordination. They land on a leaf, vine, twig or plant and die.
Dead seedcorn maggot flies usually appear stuck on plants in early spring, especially when the weather is cool, according to Iowa State University. But they can appear up to summer because they can breed up to five generations in one year, according to the University of Kentucky.