“Spontaneous generation” was a belief that certain species came into existence from things such as dirt and waste rather than by reproduction. It was a widely accepted belief until the last couple centuries.
Spontaneous generation or abiogenesis a discredited belief that living organisms can arise from nonliving things. It was finally shown to be untrue by PASTURE in his famous swan-neck flask experiments. The Harper Collins Dictionary: Biology, Page 501
In light of this concept and its rejection people have grappled with how to relate to the passages in Chazal which address the concept. In the most significant discussion we find that Chazal permit one to kill kinim (כִינִים) on Shabbos because they are not “fruitful and multiply” since they have no eggs. One is liable for killing a parosh (פַּרְעוֹשׁ) which is fruitful and multiplies (Shabbos 107b). “Kinim” are parasites which live on humans and are generally translated as lice. There are different varieties of lice but they typically have eggs, known as nits, which are easily observable (ask parents of small children and school nurses), while kinim had no observable eggs. As usual it is difficult to precisely identify and translate the species in question, and Soncino translates kinim generically as “vermin”. Parosh is typically translated as “flea”. Rashi and Tosefos (on Shabbos 12a) explain that lice “swarm” from human sweat, while Tosefos explains that the parosh comes from the dust (ibid). The second major discussion is the Minshah on Chullin 126b and the subsequent Gemara, which discuss a rodent which is half flesh and half dirt. The implications of such a creature, once the full length has developed but having died prior to completely transforming to flesh, on ritual purity is there discussed. Achbar (עַכְבָּר) is generally translated as mouse but Rashi understands it to refer to squirrel in this context. This creature is also referenced in Sanhedrin 91a by R. Ammi as evidence that it is not impossible that the dead can be resurrected from the dust.
Now with respect to the Achbar we see what can only be understood as classical spontaneous generation, dirt becoming a rodent. But insofar as the ruling depends on one determining that the entire length has been developed it only is applicable if one observes (and has contact relevant to ritual purity) such a creature. And since Chazal clearly did not discuss this for the biological speculation we must conclude that either Chazal themselves witnessed such an achbar and its development, or they relied on the testimony of naturalists of their own day. But while the Chullin passage implies the existence of such a rodent by discussing its halachic implication, R. Ammi actually asserts its existence. It is significant to note that the opinion of contemporary science not withstanding, R. Ammi’s argument remains sound. R. Ammi is responding to the objection of a min who, without specific evidence, rejected the possibility of resurrection based on the contemporary understanding of what is possible and what is impossible. R. Ammi showed, using the same contemporary understanding, a counter-example to the min’s assertion. R. Ammi showed that the min’s argument was not supported by the scientific evidence, but an oversimplification of the contemporary, albeit flawed, science. Since his opponant's argument was premised upon such assumptions, R. Ammi’s reasoning argument was valid.
Because of its more practical nature the passage concerning kinim is the basis for most discussion on this topic. It strikes me as somewhat presumptive to attempt to read Chazal’s mind with regards to the precise nature of the reproductive habits of kinim and so forth. The Sages of the Gemara where, by definition, experts in the Mishnah and therefore familiar with the approach of the naturalists of their day referenced in the above mishnah in Chullin. It is possible, or even probable, that acceptance of natural selection was not exclusive to R. Ammi or even the author(s) of that mishnah. Nevertheless we must bear in mind that they had no intent to explain the life cycle of the louse. Rather their discussion was to discuss the significance of difference between their generation and that of other species. We need to recognize that much of what we know about science, that which seems second nature, was long overlooked or under-considered. Science is “a creative endeavor” (Physics 3rd Edition, Douglas C. Giancoli page 13) and its theories “may be compared, as creative achievements, with great works of art or literature.” (ibid page 2). The “scientist” must first recognize the problem, which itself may take a good deal of imagination and then be inspired to search for solutions base on the evidence. While Chazal where geniuses and scholars in their own right, and it is reasonable to expect they had a healthy thirst for knowledge, it would be an assumption to say that they were particularly perturbed by the precise manner in which new kinim developed.
Chazal certainly did not believe that such creatures were a product of creation ex nihlo (Yesh m’Ayin), that is to say they did have a material origin. It is only with the advance of modern science that man has become so confident that all the mysteries of the world can be solved. I see no reason to believe that Chazal sought to explain phenomenoney they could not observe with the resources available to them. We have noted that halachiclly speaking there is no significance to phenomenon which cannot be observed. Although nits (the "egg" of lice) and nymphs (newly hatched lice) are visable, barely, to the naked eye it seems biologically possible that this was not the case in previous centuries.As such Chazal’s inquiry into the “birth” of lice noted they were not, to use the expression from Genesis, “fruitful and multiply”, i.e. they did not bear “fruit.” So continues the Gemara which counters with a b’raisa which seems to refer to “eggs of fleas, i.e “fruit”, but it is concluded that “eggs of fleas” (beitzei kinim) was actually a species in and of itself. So while all species may have a biogenesis, the microscopic eggs of the lice in question are not “fruit” or “eggs” from a halachic standpoint, the only standpoint we are certain that Chazal were concerned with.
At first glance it would seem counter-intuitive, some might say foolish, to suggest that Chazal did not have “spontaneous generation” in mind per se. Even conceding that they were not particularly interested in the biology we are nevertheless faced with the fact they were certainly familiar with the Mishnah in Chullin and it would seem hard to suggest that it did not provide the background for their understanding of this passage. In truth we see that despite the certainty that they knew of the passage in Chullin we find that it is not factored into the discussion when it would seem to be most relative. On Shabbos 107b Abaye queries the assertion that kinim do not lay eggs, based on a b’raisa which specifically mentions “beitzei kinim”, eggs of kinim. Had Abaye seen the discussion in Chullin applicable here he would have seen no difficulty. That sugya distinguishes between most achbarim which are fruitful and multiply and those which are formed from dirt. A b’raisa which discusses kinim laying eggs would not conflict with a passage which discusses kinim which do not. Conversely R. Yirmiah responds to Abaye by positing that “beitzei kinim” is actually the name of a specific species. Even when Abaye challenges that assertion by bringing another (otherwise unknown) reference to beitzei kinim R. Yirmiah sees it more likely that the passage speaks of a separate species than to suggest that some kinim lay eggs and some do not, just as we see in Chullin that some achbarim reproduce and some form from dirt. It might not be too strong to suggest that despite the reference to spontaneous generation we detect a degree of skepticism on R. Ammi’s part about the possibility of kinim not coming from eggs despite the “scientific” opinion of the day. R. Yirmiah, however, is only concerned with what is the observable phenomenon, unbothered with the possibility of such observations nor interested in conforming the observations with related “scientific” theories.
Rashi’s explanation (Shabbos 12a “מתירין”) that kinim “אֵינָהּ פָּרָה וְרָבָה אֶלָּא מִבְּשַׁר אָדָם הִיא שׁוֹרֶצֶת”, are not “fruitful and multiply” but “swarm” from the flesh of man. The root of שׁוֹרֶצֶת means to swarm but can imply reproduce. It is the same root used to describe the eight swarming “unclean” creatures (including the achbar) mentioned in Leviticus 11:29-30. In this context it is interesting to note that the Gemara in Chullin 127a explains the need to discuss the half dirt/half flesh achbar since the Torah’s use of the term shoretz (שורץ) may lead one to conclude that it only applies to those which משריץ, reproduce.
But perhaps it is not so but that the expression that creep signifies all that breed can render unclean, but those that do not breed cannot render unclean, and so I would exclude the mouse which is half flesh and half earth since it doesn’t breed. (Hullin 127a Traditional Press, New York City New York, Translated by Eli Chashdan, M.A., Edited by Rabbi Dr. I. Epstein B.A., Ph. D., D. Lit.).שרץ in the sense of reproduction, is denied of the “spontaneously generated” achbar. It might then be better to understand Rashi’s words as discussing the visible origins of kinim being “swarming” from human skin as opposed to hatching from eggs. Nor do I think that in is necessary to infer from the Tosefos which state lice “go forth” from the earth or “come from” human sweat that they mean to suggest that the dirt or sweat converted into kinim. Rather the Tosefos’ concern is identification and they discuss the visible origination, using verbs which can imply spacial origin not generation. Parasites whose birth cannot be attributed to eggs [which we now know are microscopic] but are rather first seen in sweat or in dirt, it is these species which the Gemara discusses explains Tosefos. Still most recent authorities have clearly identified the words of Chazal with spontaneous generation. Indeed as time progressed it is more likely that the authorities who spoke on the topic made the connection to this widely accepted belief. But it seems that most major commentators on the Talmud, or relevant portions of Shulchon Oruch do not tie the discussion of kinim to the case of the achbar, nor does the language present anywhere near a definitive description of spontaneous generation. Even those, such as the Mishnah Berurah 316:38, which negate involvement of parents (males and females) can be understood as such insofar as there is no observable link between the parents and offspring. Chazal had no basis to speculate on a microscopic genesis for lice or other species, similar to the concept אין לדיין רק מה שעיניו רואות (San. 6b).
In truth I do not think it can be established that did not have in mind “spontaneous generation”, but even without being fully aware or in full acceptance of the assumptions of spontaneous generation, the idea certainly influenced how the masses described the phenomenon. There is no other way people could have described the observable without resorting to assumption or speculation which they could not provide evidence to support. So too with respect to the rulings in the Gemara, and to an extent its commentators. I do not believe that we have enough information to conclude that they, on the whole, did accept spontaneous generation. Acceptance or rejection requires consideration and I’m unsure that it was a topic of wide interest, and even in the relevant discussion its relevance was limited. I believe this, pardon the term “agnostic”, approach sufficiently accounts for the various ways species are said to be “from” various non-living matter, the passages describe their origin from the observable facts without specific interest in or speculation about the unobservable and therefore insignificant microscopic world. We have no indication that their interest in such reproduction was biological curiosity, only halachic significance which is limited to the observable. In the end while I don’t think Chazal, or any Posek, can be faulted for deferring to the opinion of specialist of their day I find it unnecessary to conclude that Chazal widely accepted a belief which was erroneous based off of unnecessary inferences from their words.
And while it may not be directly relevant it is noteworthy that spontaneous generation has not been entirely abandoned by contemporary science. It is, at least with regards to the earliest organism, the mechanism by which evolution explains the origin of life. While I’ve seen those who object to such characterization of evolution, “Current (published 1973) theory holds that spontaneous generation of life from nonliving matter does not occur under present conditions, but that it probably did occur under the conditions existing on the primitive earth when life first arose.” Elements of Biological Science 2nd Edition William T. Keeton, Norton, page 36).
 “In 1861 Pasteur at last carried general conviction against spontaneous generation. He boiled meat broth in a flask with a very long thin neck until no bacteria were left. This was shown by the fact that he could now keep the broth in the flask for an indefinite period without change setting in, the narrow neck admitting nothing. Then he broke off the neck and in a few hours the liquid showed micro-organisms, and the meat was in full decay. That the air carried such organisms he proved by twice filtering it through sterile filters and showing that with the first filter, but not the second, he could set up putrefaction.” H.T. Pledge, Science Since 1500, cited in Introduction to Logic, 5th Edition, Irving M. Copi. Page 413)
 “As to the possibility that the Sages may have based their description of this creature on reports brought back by explorers rather than on their own personal observations, see the responsum of R’ Samson Raphael Hirsch on this and related matters published in HaMayan, Teves 5715 [vol. 16 #2].” Artscroll Mishnah Chullin
 Tosefos Shabbos 12a
 It is noteworthy that this stronger language seems to originate with the Rambam in M.T. Shabbos 11:2. The Rambam was certainly familiar with the classical notion of spontaneous generation as taught by Aristotle, to whom he gave a great deal of deference on “scientific” matters. As such the Rambam probably did understand the words of Chazal as describing spontaneous generation and wrote accordingly. It does not necessarily follow that those who accepted his rulings and adopted his language likewise understood the language to be an absolute biological account of their reproduction since it fits the observable phenomenon. It is also noteworthy that although clearly accepting the notion of spontaneous generation, when commenting on the Mishnah in Chullin the Rambam finds it necessary to appeal to widespread reports of citing such “mice”. If such reports struck proponents of classical spontaneous generation as incredible, we might better understand why the Sages where reluctant to infer anything from this example outside its immediate context, even where it would seem applicable.