Because gold is a precious metal, the quantity is scarce, and it is not so easy to get now, not to mention when ancient science and technology were not developed enough and mining and smelting were backward. At that time, it was a hundred times more difficult to obtain a certain amount of gold than it is now. Of course, gold is considered valuable.
Is scarcity easy to understand as precious? Just like in some desert areas, clean water is more expensive than gold.