First, it is necessary to determine what is meant by spontaneous generation.
The Free Dictionary says:
Merriam-Webster, however, does not give a definition for spontaneous generation, but links from a search for it to abiogenesis, which is defined as follows:
the supposed spontaneous origination of living organisms directly from lifeless matter . . .
There is some disagreement, then, about the very term, spontaneous generation. For the purposes of this post, spontaneous generation and abiogenesis are the same thing.
Spontaneous generation was studied by Pasteur, in the 19th century. If it actually happened, living things would just appear, as opposed to coming from pre-existing living things. Supposed examples of spontaneous generation included the appearance of thin worms, called horsehair worms, in horse drinking troughs. Some people believed that they spontaneously generated from horse hair, fallen into the water. Another supposed example was the appearance of mold and bacteria on food.
Pasteur's research, showing that, under some conditions, it was possible to prevent the invasion, by microorganisms, of environments that would have been conducive to their growth, led to the eventual rejection of spontaneous generation by scientists, and was important in establishing the germ theory of disease. An egg, or a small worm, must have gotten into the horse trough. A spore, or an airborne bacterium, must have gotten into the spoiled food. Infectious disease must have come from exposure.
The most important case of abiogenesis would have been the appearance of the first living things.
Did Pasteur disprove spontaneous generation? Not exactly. He did contribute to the downfall of the idea, but, in the sense that he ruled out all possible spontaneous generation by experiment, he didn't.
What do I mean? Suppose you asked me to prove that witches can't fly. I would try to find someone who is supposed to be a witch, and throw her off a high building. Surely, under such conditions, a witch would fly. (Let us not worry about petty details such as my murders of reputed witches.)
After, say, a hundred such experiments, in which flight was never observed, have I proved that witches can't fly? Well, no. In the first place, how can I be sure that my hundred women were, indeed, witches? Perhaps they were just people that someone else wanted to get rid of, so the someone else's contacted me, giving me false information.
Or, as is well known, witches need a broom to fly. If I threw my witches off a building with no broom, no wonder they didn't fly. Or, if I did, I wasn't giving them the right type of broom. Or, if I did give them the right type of broom, the buildings were somehow such that witches can't fly off of them, for example if the building was blessed during construction. Or, a skeptic could say, witches can only fly on certain days, and certain hours, and I didn't perform my experiments at the right time. Or certain rituals must be performed before flight is possible, and the rituals weren't performed, or were performed in the presence of a skeptic, which makes them invalid.
I have not, and can not, rule out the possibility that witches really can fly, if the moon is in the right phase, and all other conditions are correct. I have simply not tried the experiment under the proper conditions. However, I can still doubt that witches can fly, and my experiments may convince other people of the same thing.
In a similar way, it is impossible to prove, by experiment, that spontaneous generation can't occur. It is always possible to argue, for example, that it occurred, 8 kilometers under the surface of Iceland, on February 29, 2000, when the moon was in the right position. How can I show, by experiment, that it didn't? I can't. I wasn't there at the time. However, I can still doubt that it did. Pasteur's work helped to persuade scientists that spontaneous generation didn't occur. It didn't completely rule it out.
Whether Pasteur ever considered the implications for origins, I don't know. Perhaps he did. But, clearly, if abiogenesis of all types could be ruled out, living things could not have arisen from non-living material, but must have been supernaturally produced. Naturalistic theories of origins suppose that abiogenesis of this type did, in fact, occur, and, of course, rule out supernatural origins.
Some experiments have given support to the idea that life arose by abiogenesis, although we can't be completely sure what conditions were like on earth a few billion years ago. So abiogenesis may have occurred, and caused the appearance of the first living things. In fact, if you follow my argument above, you will see that it is impossible to experimentally rule out the possibility. I can doubt it, and, in fact, do doubt very much that that's how life began, but I can't scientifically prove that it didn't. I refer you to my earlier post on Hebrews 11:3, which speaks of the connection between faith and origins.
In sum, I don't think it is correct to say that Pasteur proved that spontaneous generation hadn't occurred. It is legitimate to doubt the possibility, in the present, or in the distant past, but it can't be disproved.
Thanks for reading.