Nobody ever sat down and decided that gold would be the money of the ages. There was no meetings of kings or priests declaring that Gold would now be the universally accepted unit of exchange. Gold and silver emerged as the best money.
But Why Gold and Silver?
To answer this question all we need is a periodic table.
First let's remove the gases as they could never be used as money for obvious reasons.
Next let's remove anything that dissolves in water or reacts with air (whether it corrodes or bursts into flames)
Next let's remove anything radioactive, because you don't want your money to kill you
That leaves us with 5 precious metals Gold, Silver, Rhodium, Platinum and Palladium
Neither Palladium or rhodium were discovered till the 18th century which rules them out as early money
Lastly we rule out platinium is its melting point is around 3000 degrees celsius which was far out of reach of mans early furnaces