There is actually research in that area! Apparently one can make a vaccine that trains the immune system to attack and remove drugs. But it could interfere with medical procedures because of the overlap with recreational drugs. Also the huge ethical and moral questions it poses like who gets final say over what you do with your own body. Unlike a viral disease, getting high isn't contagious and doesn't directly and immediately affect those around you.
Would they though? This sounds like it could give withdrawal symptoms, and it wouldn't solve the other issues that most highly addicted people face ...
It would be great for folks who are in remission and don't want to be tempted back though
Voluntarily taking it isn't such an issue. It's when the state imposes it (ie. 10 year sentence for a related crime OR take this vaccine and get out early) or the case of a parent getting their child to take it. Does a parent have a right to take away a child's ability to get high? Irreversibly and lasting into adulthood for said child? Even if it's "for their own good" and in the face of changing legal landscape where it may not be a criminalized activity in future like with cannabis?