Unlike every other metal known since antiquity, gold doesn't tarnish or oxidize or decay. It's the very embodiment of purity and immortality. It invokes the divine. If you make something out of gold and you keep it safe, it'll look pristine indefinitely. This also makes it great as an offering to (the) God(s).
Silver tarnishes, but very slowly and can easily be polished to a mirror finish. This makes it well suited to make "nice" things where gold isn't necessarily appropriate or cost-effective, and it can be added to gold to bulk it up and improve its material properties without ruining its luster.
Copper tarnishes quickly and forms a green patina in salty sea air, and the vast majority of ancient settlements happened to be on the coast. It's still a useful metal, but it has to be kept up, a constant reminder of one's mortality. It's more suited for tools and cookware than as an offering to God.
Rarity helps a lot with this too, of course. It doesn't matter how immutable gold is if you can just find it anywhere. This also means it's great for turning into coinage with your face on it, to remind everyone exactly who's in charge.
Once upon a time, pure iron used to be even more valuable than gold. Before we learned how to smelt it, pure iron was extremely rare, and the only pure iron that could be found on or in the Earth's surface came from the heavens (meteoric iron). Finding a pure chunk of iron was tantamount to winning the lottery.
The same goes for aluminum. Despite being one of the most abundant elements in Earth's crust, pure aluminum almost never occurs naturally. In the 19th century, people had cutlery made out of aluminum because it was fancier than silverware. It only dropped in value once we started to refine it on an industrial scale, which involves electrolyzing molten alumina, requiring an immense amount of power.
Long story short, value is relative. Iron and aluminum got cheap because we figured out how to make more and more of it. Gold and silver remain precious metals because they only got rarer and rarer as more people went looking for them, and their value only went up as we started finding practical uses for them.