Since my own comment has gained so much attention in other answers, I thought I'd turn it into an actual answer myself.
The Prepositions With and By
Here are the definitions of the senses of the prepositions in use, per Merriam-Webster:
6 a —used as a function word to indicate the means, cause, agent, or instrumentality
hit him with a rock
pale with anger
threatened with tuberculosis
she amused the crowd with his antics
4 a : through the agency (see AGENCY sense 3) or instrumentality of
// a poem written by Keats
// death by firing squad
// taken by force
// happened by luck
I had used agent in my original comment when describing by; however, that can get confusing because of the multiple senses of that word. (And note that the definitions here actually use one sense of agent in association with the definition of with, while agency is used in association with by.)
It's perhaps better to express it differently.
- When you use with, you are talking about an object or effect that is applied as a result of an action.
→ I was poisoned with arsenic.
- When you use by you are talking about the subject or cause of an action.
→ I was poisoned by a criminal.
Putting the two together:
I was poisoned with arsenic by a criminal.
Forget the technical distinction between the virus SARS-CoV-2 and the disease COVID-19. Let's just assume that when people talk about the coronovirus they are talking about a single thing.
Going back to the difference between with and by.
"I was poisoned with arsenic by a criminal."
Question and answer:
"Who or what poisoned you?"
"What type of poison was it?"
But coronavirus actually does double duty, playing both semantic roles at the same time.
"I was infected with the coronavirus by the coronavirus."
Question and answer:
"Who or what infected you?"
"What type of infection was it?"
This means that both of these are grammatical:
I was infected with the coronavirus.
I was infected by the coronavirus.
Even though the nature of the word coronavirus allows the sentences to often be used interchangeably, there is still a subtle difference between the two upon careful analysis.