Someone already mentioned the world CULTURE. There's your answer.
Gold is valuable because it's value is CULTURALLY accepted. In other words, we, people, have decided that it is valuable. And in principle, on its place could have been any other substance, chemical element, or metal.
The answers that gold is valuable because it is RARE are ridiculous. There are other metals that are rare, yet they have not taken place of gold throughout the human history.
It is of course smart to ask another question, Why then gold has been accepted by cultures as a precious substance, a metal of value. To answer this question, those of you who seek true answer, need to turn to the origins of human RECORDED history and the cradles of civilization, the EGYPTIAN and the SHUMER cultures. These are the cultures that first started to highly value gold, mine it, regard it as a sacred metal in many senses. So, gold first had religious purposes and meanings, served as decoration for all early temples and churches, and then it became the sought-after metal in most cultures. Why gold became a substance heavily used in rituals and worship objects is another story. If you start reading more about the Shumer and Egyptian civilizations, you will surely find answers to this question.