In Miri from STOS, I do not think specifically an artificial virus or artificially-modified virus is mentioned, but Wikipedia says, "The party find a medical research laboratory and look through documents for clues to the disease, discovering that it is a side effect of a life-extension experiment."
Now, this is not quite explicitly saying that a virus or I guess bacteria as the other possibility was deliberately created to spread the therapy -- perhaps even the experiment just ended up modifying a microorganism which does not have any value but is responsible for illness which the life-extended children are protected from. I believe this story was novelized or a novel about the same planet was written and perhaps the novel goes into this.
I only mention Miri because it is a natural guess as the first story to feature a therapy spread perhaps via virus but not necessarily.
Of course, I am Legend with Will Smith is explicitly the chicken pox virus changed to fight cancer. But I suspect this is not the first story in which this therapeutic idea is presented. Note that the book has no concept whatsoever of a virus or bacteria (it is a bacteria that causes the disease) being modified for therapeutic reasons -- I think Matheson has it as naturally occurring. In The Omega Man, it is germ warfare and maybe the virus/bacteria has been modified; but again, not to spread anything therapeutic.
My guess is, the first story in which a contagious organism/virus is created to spread a beneficial therapy was written after the discovery of DNA's structure. I think prior to that, viruses were considered too mysterious for any writer to envision changing them. I would of course welcome being wrong.
Summary of question: First story (or movie, etc.) in which a disease is modified to be beneficial?