What prevents them exchanging gold for $ like all other gold producers are doing? This is probably what they themselves were doing beforehands?
Also helps to look like you're doing something about a debt crisis even if the net effect is minimal or negative...
Gold is, for all intents and purposes, usable as money, at least between sophisticated parties such as governments. It lacks some of the features of USD, but if Ghana is out of USD, then those features don't matter to them.
Look at HN's somewhat sophisticated audience heralding it as a power move against the dollar rather than a country scrabbling around for ways to dig itself out of a financial hole caused in part because the dollar holds value much better than their own currency.
Indeed, having a better engineered money system is one of the things that make rich countries richer.