Both gold and money have utility and are fungible.
The utility of money is being able to transport large amounts of value/wealth with very little weight, and in a way that is tracable. Gold on the other hand is quite heavy but more importantly if stolen is untracable so is also much harder to retrieve and much easier to offload when stolen.