Gold nib fountain pens - invented around 1850 - were originally the standard as early (fountain pen) inks had corrosive properties. Although corrosion of nibs is no longer a problem, gold nibs have other advantages.
Pens of all kinds of metal (alloys) are often tipped with 'iridium' *, as the tip will have to endure the most. Apart from thickness and shape, the material qualities of the rest of the nib are decisive for the writing experience, as they determine ink flow and comfort of writing (that is, when compared to similar nibs of other materials on pens of equal size, shape, weight, balance, &c.).
Gold is the most malleable of the metals, so pure gold tips will relatively easily deform under the pressure of writing. This is why standard gold fountain pen nibs are made of 14, 18, or 21 karat gold (out of 24k), meaning (+/-) 42%, 25%, or 12,5% respectively consists of other metal(s) to strengthen the nib.
Nevertheless, when compared to other nibs, gold nibs are known for their suppleness, springiness, and a softer writing experience that adapts to the writer's hand.
Golden nibs are also praised for their durability. Gold (alloy) will last longer as it is less prone to corrosion than other metals, but modern steel alloys in combination with most modern inks will wear relatively slowly as well.
Whether golden nib fountain pens are worth the investment is impossible to answer objectively: it depends on how often and much one writes, personal preference with regards to the writing experience compared to the (wealth and often comparable qualities of) alternatives and the aesthetics of the precious metal over that of other materials, the cost-quality and cost-durability ratios, and whether or not and to what extent one regards such a pen as a statement and symbol of prestige.
* More a synonym for 'fountain pen tip' than the actual metal, see https://www.nibs.com/blog/nibster-writes/wheres-iridium
One author makes the compelling case that gold nibs are only really worth it when you want the additional flexibility for line variation.