The interesting question to me is why people in earlier times valued gold at all (i.e. before understanding its uses in electrical circuits, etc.). Why would people care for it? I mean, OK it doesn't rust, but why's it so special?
Anything as difficult to extract as gold is worth about as much (gold isn't especially profitable to mine). Gold just happens to be about as indestructible as anything we know of and have a very convenient value/volume ratio to procure. It is also a pleasing shade of yellow, which counts for something.
If we are trading without me having something you need right now then I need a way to show you that I'm not some layabout asking you to do stuff for free. Gold is a guarantee that if we unwound the chain of trades at some point someone did something real. That sounds really silly, but it turns out that some axiom like that is needed for trading to make sense.