It was a controversial subject. At the time many scientists believed that influenza was caused by a particular bacterium commonly known as Pfeiffer's bacillus. Indeed, when sputum samples were taken from patients it was often possible to grow ("culture") the bacillus in a petri dish. However, Pfeiffer's bacillus was not found in every influenza patient which should be the case if it is the pathogen. The fact that it was not found in all patients was often explained away as the result of mistakes in the process of preparing the culture and there was some merit in that idea. Pfeiffer's bacillus was notoriously difficult to culture.
No one had yet seen a virus in 1918. That was impossible until the electron microscope came along in the early 1930s. Their existence was inferred from the fact that fluid taken from people infected with a disease could still infect others even after passing through porcelain filters that could remove any and all bacteria. This was first discovered by a Dutch scientist, Martinus Beijerinck, in 1898 while studying disease in tobacco plants. During the pandemic a scientist in Japan named Yamanouchi (I have not been able to find his full name) took sputa from flu patients, filtered some of the samples, and then put them in noses and throats of volunteer test subjects. Both the filtered and non-filtered groups came down with the flu. Other similar experiments during the pandemic produced mixed results so nothing was definitively proved yet.
TLDR: An increasing number of scientists believed influenza to caused by a virus, but there was no definitive proof and a plausible alternate hypothesis.
Sources:
Barry, John M. 2004. The great influenza: the epic story of the deadliest plague in history. New York: Penguin Books.
Brown, Jeremy. 2019. Influenza: the Hundred-Year Hunt to Cure the Deadliest Disease in History. Thorndike Press.
Spinney, Laura. 2018. Pale rider: the Spanish flu of 1918 and how it changed the world. Perseus Books.