Consider the context. In Antiquity and the Middle Ages from Aristotle on, people thought that many living things (from microbes to mice) would arise through spontaneous generation. Seemed sensible enough; if you don't pay close attention to animals getting somewhere, and you have no knowledge of anything microscopic, it can easily look like animals just come out of the environment. After the Enlightenment scientists got better understandings of reproduction on the one hand, and made many experiments showing that under certain conditions (like keeping meat sealed so flies couldn't get to it for example), life didn't, in fact, spontaneously generate in the way it was previously thought it did. At this point the idea that all living things come from the reproduction of other living things of the same species became increasingly accepted.
Pasteur's experiment was more or less the death knell of the spontaneous generation hypothesis; some previous experiments had shown microbes growing after a flask was supposedly sterilized, or kept the flask sterile by keeping air out (which opened one to the argument that spontaneous generation required air). His showed microbes not growing in a flask where air could flow but dust did not settle because of its shape, and immediately growing when the flask was tipped and dust fell in.
Pasteur's experiment didn't so much "prove that life only comes from life", as disprove a specific other hypothesis that existed at the time. And in that sense it is still consensus biology: No biologist today thinks that snakes, mice, microbes, or even viruses can arise directly through abiotic processes. If you replace "life" with "modern life", the principle is true as far as we know.
Now biology has advanced a lot, and there is a different context, with people asking different questions and advancing different hypotheses to answer them. The question of the origin of life is one such question, that has nothing to do with what Pasteur was trying to prove. And that's where the "modern life" caveat becomes relevant; while all modern living things are too complex and specific to arise directly via abiotic processes, it doesn't follow that the same is true of the first living things. We know that living things used to be different from how they are now; and in fact when looking into the past via the fossil record and genetic evidence we find clear patterns of gradual development of the modern biosphere's diversity and complexity from simpler and more generic ancestors. While it is harder to find evidence for the evolution of early cells, because the genetic evidence is muddled by the time scales involved and the fossil evidence near-nonexistent for obvious reasons, it is sensible to figure that similar patterns would occur there, and that the earliest cells were as different and simpler than a modern cell as a Precambrian worm is from us.
Here is a video of Nick Lane talking about a promising hypothesis on the origin of life. It sort of illustrates how different, and simpler, those primordial living things could have been compared to current organisms.
https://www.youtube.com/watch?v=gb7pZyks_HE&t=1151s