I found both these two versions are being used
Cambridge Dictionary gives different definitions for them:
to pass a disease to a person, animal, or plant
for "infected with" and
If a place, wound, or substance is infected, it contains bacteria or other things that can cause disease
for "infected by".
However, I can't distinguish those two meanings. Could someone please give a hint?
Best Answer
We use "by" when we talk about the agent that infects us with the disease. We use "with" when we talk about what we are infected with (i.e., the disease). Jason's comment and Michael's answer explain this quite well.
However, there is a distinction between the names of the agent and the disease in regards to COVID-19.
According to Mayo Clinic: Coronavirus disease 2019 (COVID-19)
Also see CBC News: What we know (and don't know) about the coronavirus outbreak.
So, it is SARS-CoV-2 that infects you with COVID-19.
I should probably point out that this distinction is not something that the average person really pays attention to (or may be even cares about?). As Kat says in comments, they may even use the terms interchangeably.