Panspermia is an attempt to explain one inconsistency in our observations so far: it appears that life spontaneously emerging from inorganics is hugely unlikely. On other hand, geological records show that life appeared on Earth very soon after it became viable.
If life on Earth originated somewhere else, then this discrepancy can be made to disappear. For example, abiogenesis only needs to arise once within a large radius around Earth and within a much broader time margin. Hence it can be a very rare event while still not making early life on Earth a unique event in the universe.
I don't personally believe panspermia is likely. But it is a valid theory (although without much supporting evidence as far as I know).