Gold can be extremely useful; however, it's not worth going out of your way to pick it up unless your character is wearing a large amount of gold find, since the time/reward ratio is very low for picking up piles of 4-5 gold. Piles of 4000-5000 gold, on the other hand, are worth the trip.
Most players need gold for two reasons: reviving mercenaries (especially sorceresses with Insight or Infinity mercenaries, who lose effectiveness when their mercenary dies), and repairing weapons and armor (mostly for melee characters).
There is, however, a valuable use for gold if you can get it in large quantities: gambling for rare circlets and amulets.
Necromancers will often find themselves automatically building up gold in quantity, because they don't have a gold sink, but the most effective purpose-built gold farmers are said to be barbarians encrusted with Lem runes, running the council and horking dead bodies with find item. Council runs are also known to be one of the best sources of runes, producing many more high runes per unit time than Countess runs.
Several of the best items in the game can be gotten by gold farming and gambling, in particular +2 class skills circlets with 20% faster cast rate (particularly valuable with faster hit recovery, good resists, and/or dual sockets). Because circlets, coronets, tiaras and diadems give a boost to the item's magic level, gambling for them has a decent chance of creating good items even for mid-level characters.
Some of the magical (blue) circlets can also be quite valuable; for example, the highest magic find helm is an extremely rare magical tiara/diadem with three sockets (from a specific prefix) and 35% magic find (the maximum possible for the best suffix), fitted with three ist runes, and the best chance of finding one is from gambling.
High level characters (level 86 to have a chance, level 95 for the maximum chance) can also gamble for +2 class skills rare amulets with 10% faster cast rate and other bonuses, which can have very high trade value, partly because reaching a good level to gamble for them is extremely tedious. (Crafted caster amulets with 15-20% fcr are more valuable, but good rares with more affixes than crafted amulets are often better for characters that reach their target fcr with only 10% from the amulet.)