Must we believe that spontaneous generation of lice occurs, or that it did, at least, during Talmudic times? Many claim we must, pointing to the fact that in this instance, there is a drasha (kind of; see Shabbat 107b) that discusses spontaneous generation, and we can't invalidate a drasha. Some (I believe Rabbi Shlomo Zalman Auerbach, for example, as well as Rabbi Shlomo Fisher, in Derashot Beit Yishai, siman #47, fn. dalet) suggest Chazal really meant just that the reproduction of lice is not visible to the naked eye, and therefore is not recognized from a halachic perspective; but that they were not, in fact, contradicting the modern understanding of how a louse forms. I'm uncomfortable with this explanation; how are lice different from other insects in this regard? Also, the fact that the entire ancient (and medieval) world believed in spontaneous generation is quite suggestive.
I think we can preserve the validity of the drasha even if we think that Chazal were wrong about spontaneous generation of lice. The drasha (look at it carefully - Shabbat 107b), according to those who argue with Rabbi Eliezer, says that a species must reproduce, like the eilim me'odamim, in order for killing it to be prohibited on Shabbat. It doesn't specify lice. A Talmudic rabbi who thought that lice didn't reproduce would, indeed, derive from this drasha that killing lice is not prohibited mide'oraita, but the faulty science involved in his conclusion would reside exclusively in his application of the drasha, not in the drasha itself. And if the actual drasha doesn't assume that lice are reproduced spontaneously, then we are not obligated to do so either.
But why would there be a drasha about species that don't reproduce, if all species do reproduce (as per modern science)? Doesn't the drasha, regardless of whether it's really talking about lice, clearly endorse the notion that spontaneous generation of animals does occur? It does seem to, but I don't think that's at all in conflict with modern science; in fact, I think it can be explained using modern science. Modern medicine and biotechnology perform new wonders on a regular basis. There is now very serious talk of growing people extra sets of organs, to be used in case the originals need replacement. Such procedures are already in place for some organs. Animal cloning has been done. Test-tube fertilization has been done. Genetic modification has been done. Biologists can create all sorts of amazing things in today's laboratories. Is it far-fetched to think that one day they will be able to make animals "from scratch" (if, indeed, they can't already do it today)? I think that if science wants to, it will definitely be able to make, let's say, a louse, from a bunch of inanimate matter. Would one be permitted to kill such a louse (or fly, or deer) on Shabbat? Mide'oraisa, yes - that's what it says at Shabbat 107b. It may thus be that the drasha, far from being scientifically backward, is actually forecasting a level of scientific sophistication that man has only recently begun to see as within the realm of the possible.