One note to be careful with this type of thing (the Japanese refer to these circumstances as be動詞 + 分詞):
“The flu infected him.” Transitive, Active.
“He was infected by the flu.” Transitive, Passive
“He was infected with the flu.” Intransitive, PARTICIPLE (not actually passive unless you mean that both he AND the flu were infected).
As the first example is transitive, 感染する cannot produce this translation accurately from a grammatical standpoint.
The second statement would translate to 感染された from a grammatical standpoint, though, we don’t really say this in either English or in Japanese.
The third statement would translate to 感染した from a grammatical standpoint.
In English, we use the past participle in combination with the verb “to be” in order to create an intransitive statement. We shift the transitivity from the participle to the transitive “to be,” allowing for the use of a transitive verb without an agent.
However, we also use “to be” with the past participle to create the passive voice. However, unlike the the intransitive usage of this construction, we are able to add an agent through a prepositional clause, most commonly beginning with “by.”
In cases where “by” does not function, you know that you shouldn’t use an intransitive passive in Japanese: You can be frightened by someone, you cannot be afraid by someone, and the context is very different whether you can or cannot be scared by someone.
One example I know where I do hear 感染される is viruses of the electronic kind (computer or phone virus). I think, since you never actually see the viruses or bacteria that make you sick, it just feels weird to place agency on them. It’s not like they’re out to make you sick or kill you, after all (well, bacteria, at least just want to survive and reproduce; viruses are a different story).