I've always assumed Sauron created the eye-flies deliberately, through vanity
and experimentation.
However, it could also be an entirely passive side-effect of magical "pollution"- there are many other examples of Sauron's general corrupting influence on the surrounding natural world.
Finally- from a purely in-universe standpoint, as I don't think this is what Tolkien was going for- yes, as
Galadriel suggests, it could be the result of artificial selection by superstitious minions, along the lines of Carl Sagan's suggested explanation for "samurai" crabs.
Take your pick.