Because the community believes their value will outlast the currency system. People have believed the same thing about tulips, peppercorn, wine, and buildings (or rather, land).
Well there’s residual value in metals as you can build stuff with it. Agree that the vast majority of the value of precious metals is contextual, but I guess you can appeal to human’s love of shiny stuff plus history, beyond just community context.