Exactly. Several countries have kept a reserve of gold for centuries, but probably not out of a fear that they will suddenly need a bunch of ductile metal.
1. It's shiny: it can be used for jewelry and thus display wealth and power to fellow citizens.
2. It doesn't corrode, which means it keeps it value over time. You can store it in a a chest or a basement. (And like many metals, you can melt it into whichever shape you want, which makes it easy to seize from your enemies or taxpayers or whatever...)
All the scientific and practical uses you cite are recent (last century).
Before that, warriors didn't make swords with gold (other than decorative motifs), and craftsmen didn't build ships with it either.
"Investing" in metals today isn't limited to gold, you can invest into silver, platinum and other metals which aren't that different from gold with regards to interesting properties.
Basically, gold is valuable because it is useful. For example:
* Gold is the most maleable and ductile of all the metals.
* Gold is very efficient for transmitting heat and electricity.
* Gold has the highest corrosion resistance of all the metals.
* Gold does not oxidize.
* Gold can be used to make jewelry, which people find naturally attractive. It is the only "gold-colored" metal.
* Gold is used in electronic components: connectors, switch and relay contacts, soldered joints, connecting wires and connection strips.
* Gold alloys are used for fillings, crowns, bridges and orthodontic appliances.
* Gold is used as a drug to treat a small number of medical conditions.
* Small amounts of gold are used to remedy a condition known as Lagophthalmos, which is an inability of a person to close their eyes completely.
* Radioactive gold is used in diagnosis. It is injected in a colloidal solution that can be tracked as a beta emitter as it passes through the body.
* Gold is also used as a lubricant between mechanical parts on space vehicles.
* Gold is also used when making specialty glass for climate controlled buildings and cases.
* The visor on the helmet of an astronaut's space suit is coated with a very thin film of gold.
What can you do with a Bitcoin?