Actually, I have two answers why.
1: The "mystery" of the hydrogen leaks were no mystery at all. The Space Shuttle rocket valves and motors were fabricated out of the same inferior carbon-molly metal as the Hydrogen Chambers were. The one inherent flaw of carbon-molly is its tendency to develope hairline fissure-cracks when during its manufacture it is placed in a liquid salt/brine bath for annealing.
The crystalline structure of carbon-molly is what caused it to be unacceptable for Space Shuttle applications, yet NASA used it anyway, inlieu of the chrome-molly specified by its own engineers! Because of this the shuttles were bombs waiting to explode. It was just a question of when.
2: Technically the Morton-Thyokol O-ring did not fail. What failed was the carbon-molly base-metal-groove in which the O-ring was seated, allowing liquid hydrogen to escape through the hairline cracked O-ring seat resulting in its pushing past the O-ring with explosive force..
NASA knew this could possibly happen. NASA was betting against the odds that it wouldn't and lost
All the gold in Fort Knox. Literally, not figuratively, it literally took all the gold in Fort Knox for NASA to fix its carbon-molly problems.
What had to be added to the metalurgic content of the carbon-molly to make it safe? Gold, 24-Karat gold!! As the gold-carbon-molly mixture cools in its salt/brine bath the last component to solidify is the gold. In other words, the gold stays molten just long enough to flow via capillary-action into the hairline fissures as they form during the cooling process, functioning as a solder-brazing filler material.
NASA continued to hedge its bets and use the old off-the-shelf carbon-molly rocket valve and motors parts for routine maintenance, hence the "mysterious" hydrogen leakages throughout the life of the shuttle program.
With the retirement of the shuttle fleet Uncle Sam is just about now replacing the fake gold bars stored at Fort Knox with the real gold recovered back from the recycled Hydrogen Chambers.