You are confusing two things. AntiSEPTICS and germ theory were both well established by the Spanish Flu. AntiBIOTICS were not. In other words we knew how to prevent surgical infection but not how to treat a bacteria that had already settled into someone's body.
Louis Pasteur came up with and proved the germ theory in the 1860s. Joseph Lister proved in 1865 that carbolic acid would prevent infection in surgery. Adoption took many years, but by the 1880s antiseptic surgery was widely adopted and Lister was made a baronet in recognition.
The Spanish flu was 1918, decades after the widespread adoption of antiseptics.
The first antibiotic, penicillin, was discovered in 1928. But it did not enter medical use until 1942. This was not a result of doctors resisting a good idea though. Penicillin is created by a bacteria. How do you produce useful quantities of a substance that in concentration kills the very thing that produces it?
You are correct, my bad. But the production problem is what I described. The fungus is resistant but not immune to its own poison. It therefore proved very hard to produce commercially viable amounts. However once a mass production method was found, it was considered vital to the war effort and we quickly ramped up production.
The Broad Street Pump in 1854 London was the thing that really got germ theory going.
Before that, people reasonably were suspicious of germ theory based on their understanding of chemistry. If you dilute a bad substance in the Thames, there is just no way it can be that deadly, dilution wins. They had no idea that the substance could self-replicate.
Dr. John Snow started out knowing nothing, but in a feat of science that still amazes, he helped the world learn a lot. His dogged persistence has saved billions of lives by now.
Fun Fact: After they realized London needed a proper sewer system, they knew that just digging up the streets would never again happen. So they built the sewer system at well above max capacity. Nearly 150 years later, London is now starting to think about improving that capacity.
People did know about self-replicating substances; they'd been using them for making beer and bread for millennia. The nature of yeast was a mystery, but the capacity of fermentation to spread through a nutrient medium was well-known. An edition of Cooley's Cyclopedia I read from around that time attributes fermentation to a particular kind of molecular excitation, which is only true in the sense that it's true of all physical processes on materials made out of molecules. He gives some recipes for producing yeast by spontaneous generation (or, as we now know, from airborne or foodborne spores).
Amusingly, among the numerous recipes for deadly medicines made from mercury, arsenic, and lead, Cooley also gives a number of quite effective disinfectant recipes. He rejects the "contagion" theory that infectious diseases require contact to spread, preferring the "miasma" theory.
I think Pasteur's experiments with the beef broth in the 1860s were what really convinced all philosophers of the germ theory. Snow already believed something similar (contagion from "morbid matter"), but the Broad Street Pump results did not convince the doubters quite as effectively.
A lot of the future-proofing and high quality of the work is due to Joseph Bazalgette. The decisions made and the reasons behind them are really interesting. The Great Stink, The Princess Alice Disaster, London’s lost rivers etc. https://en.m.wikipedia.org/wiki/Joseph_Bazalgette
IIRC: Antibiotics and germ theory were invented. But the scientific community and the medical community weren't fully on board yet.