Because people are willing to trade for it. People are willing to trade for Gold because:
- It's aesthetically appealing.
- It's useful (electronic and engineering applications)
- It's long lasting (it doesn't corrode, or deteriorate appreciably).
- It has semantic value (because we culturally believe gold is valuable).
The value of gold goes up because the demand for it goes up, while the supply has been basically static (or growing at a low static rate) for a long time. The demand is going up because people see it as a safe place to put their money.
Another reason Gold's value in dollars goes up, is because the value of the item it's traded against (dollars, euros, yen, etc) goes down, while it's own value stays roughly the same.
You point out Gold is not as liquid as cash, but gold (both traded on an exchange, and held physically) is easily sold. There is always someone willing to trade you cash for gold. Compare this to some of the bank stocks during the first part of our current recession. People were not willing to give much of anything for your shares. As the (annoying, misleading) advertisements say, "Gold has never been worth zero".