I asked a few questions in another thread from 2003, and parts of my questions were answered but not the one in my subject line here.
There are some vaccines against bacterial infections, like TB, but not for things like strep. I’ve had strep a dozen times, but you get chicken pox once and you’re done.
The TB vaccine is not really used much and may be minimally-effective. The more common bacterial vaccine is for tetanus.
Viruses are not really living things. They consist of a protein shell containing the data (usually in RNA form) needed to make more of that type of virus. They have no progressive metabolic processes, just an injection mechanism to force the host to produce more viruses. They have no real life cycle outside of parasitic replication. Defeating them is a matter of disabling their ability to replicate, which could, theoretically, be as simple as clogging their injection point.
Bacteria, by contrast, are unmistakably living things, which have their own metabolic processes and usually reproduce on their own. It is typically the reproductive process where stuff like antibiotics cause bacteria to fail, because a large fraction of bacteria do not attack the living host but create other issues (like toxic by-product generation). In fact, the human microbiome includes a staggering contingent of symbiotic bacteria without which we would be dead.
Bacteria have a lot of cell wall proteins, and most of them are commonplace, so identifying one surface protein to mark can be a major challenge. It might not even be possible in some cases to distinguish a harmful bacterium from a harmless or important type. It is a far greater challenge to defeat dangerous bacteria a priori than with much simpler viruses.
Sometimes they’re challenging to develop for various reasons, but the numerous vaccines against bacterial pathogens include ones for meningococcal disease, (Strep) pneumococcal pneumonia, Haemophilus influenzae, tetanus, diphtheria and pertussis.
Article explaining why it’s been tough developing vaccines against targets like Staph aureus and Pseudomonas. Antigenic diversity, complexity of effective immune responses and lack of good animal models for vaccine studies are cited.