Well, like that milk in your fridge, things have code dates. It's not like bombs really "go bad", but they do get obsolete, so it's a good idea to use up the old stuff that is less advanced than the new stuff then replace it with the newest issue.
Actually, they do "go bad".
Most munitions have a "shelf life" of roughly 10 years. After that they need to either be pulled out of storage and checked, or destroyed.
Now the checking can vary, depending on the technology involved. As for conventional "dumb explosives", that means generally pulling out a handfull of the same lot and taking apart a few to see how the insides are holding up, then test firing a few to make sure they are still properly working. This is to make sure things like fuses still work, and that the explosives inside have not degraded in any way (seperation, clumping, etc). Most of the time those fail because of QAQC issues when originally manufactured and not detected earlier, or through improper storage.
For the more modern "smart munitions", it is much more likely. The bombs themselves rarely go bad, but the more sensitive electronics and gadgets placed on them (and things like rocket motors) do indeed go bad. Even solid rocket propellants have a much shorter shelf life than the explosive components. So an old AIM-120 may still have a perfectly functioning warhead, but seperation and clumping of the propellant means that it is no longer an effective weapon unless you drop it on somebodies head.
Having worked for years at a Naval Weapons Station, I have seen many of these steps in munitions storage. Older munitions pulled out of the bunkers to be tested, and then put back in or sent for destruction if they fail the tests and are not worth fixing. And in more recent years I have seen this with PATRIOT missiles. These have a shelf life of roughly 10 years, and after that are generally retired (because of advances in capabilities compared to older generation missiles). However, most of the "outdated" ones are not destroyed, but expended in life fire exercises.
I have seen a great many of those over the years, and never saw a single "new" (1-3 years old) missile fail to launch. But when we are expending 12-15 year old missiles, the failure rate is around 30%. And it is not in the warhead at all, but the rockets themselves. They either fail to go off, or cut out during flight.
And if you look at a lot of our more modern anti-equipment munitions, warheads themselves are starting to go away. Kinetic Kill is now the name of the game when taking out things like tanks, aircraft, and missiles. So these types of munitions do not even have warheads in them anymore.