Not OP, but it's kinda like boiling or alcohol versus poisoning (which is essentially how most drugs work). Certain attack vectors are literally unevolvable, as they would require fundamentally different building blocks to be able to be able to handle, which is too big of a leap for evolution to make.
The challenge is:
1) finding something that kills mostly/only cells we don't want in or around our cells
2) kill them in such a ruthlessly efficient way that there are no survivors
As a sibling points out, the vacuum of space does #2 quite well. Actually we have a lot of stuff that handles #2 quite well. But #1, differentiating between "good" and "bad" with our murder machines, is pretty much an unsolved problem.
We need to create nanides: nano-scale machines that can differentiate between microbes and destroy the bad ones. Just don't piss them off with a phaser blast when they get into the ship's computer core.
Look into immunology, it's a biologically mostly solved problem with the mammalian adaptive immune system.
...In the sense we're here because an implementation evolved, however, the physics and minutiae of the problem domain are so numerous that even nature with billions of years of time, and the happy accident of intelligent tool using life haven't been able to make significant inroads on nailing down the problems space in an "ahead of the machine" sense yet.
The Covid pandemic shows that immunology is very much not a "solved problem". Any time someone dies of a disease caused by a virus, bacteria, or even cancer, this shows that immunology is very much unfinished.
But that's the thing, it's not very intuitive but selection pressure doesn't distinguish between dead and banished. Selection pressure means "instead of 100k bacteria, there are now only 100 bacteria that are the best at surviving this environment, and there is enough food for 100k, so they are going to grow back to 100k very quickly, all of them with the better survival skills"
Interesting point! I was thinking washed away germs remain in the gene pool so they aren’t selected out, but I guess the odds that they creep all the way back into the hospital to reproduce with the general population is quite low.
AIUI, a "gene pool" is much more of a thing with sexually reproducing organisms, where mutations either quickly spread across the gene pool, or they get diluted out, because you keep mixing everything together every generation. However, with bacteria, you just have both old and new bacteria each doing their thing.
If we start killing everyone by sending them to the vacuum of space, will we evolve to survive those conditions? Some solutions just defy what adaptation is capable of