Making extra genetic material and their resistance products can be a liability if they're useless (and so would slowly be lost), but there's all sorts of chemical combat between microbes in lots of environments and you can't be sure the resistance adaptations aren't good for other things too, potentially something different.