Like other posts, this article takes takes Old-School Essentials for reference, but can be applied to most retro-clones.
Random treasure generation is a staple of most early editions of D&D. Big emphasis on random! Those tables may as well create non-existent hoards or, at the other end of the spectrum, mountains of gold and jewels and magic items all in the same place.
The mechanical procedures for random treasure generation are really awful and long, and it is much better to use an online generator such as the one Necrotic Gnome offers on their site.
To some, that's a great feature, to others less so. A lot depends on your play-style, especially on how fast you game goes. If the group discovers a treasure hoard every three sessions, and it's 100 copper pieces because that's what you rolled, that's one thing; if in three sessions they put their hands on say, nine randomly rolled hoards, then things even out much better.
For Referees who don't like random (or too much random), the Old-School Essentials book lists average values for each treasure type, a simple feature which I had never found in other books and one that really helps as a starting point if you want to manually determine/adjust treasure.
Consequences of Random
Random treasure adds another level of thrill to the game, one that is definitely not there if you always go with the average treasure value! On a psychological level it may probably generate the same kind of addiction of instant lotteries: a lesson action RPG video games such as Diablo have learnt well.
A randomly rolled poor hoard is a disappointment for the players, true, and definitely, quite literally, adds nothing to the game, except a lesson learnt: if you want treasure, you should follow rumors about treasure, not rush into every goblin lair on the map.
At the other hand, a superb roll may mean two things: fast forward advancement for the PCs, and probably the introduction of some crazy magic item you wouldn't have put in there if you had manually chosen the treasure. Which is an awesome thing! It has a chance to inject the campaign with freshness and take the emergent story into wild new directions.
Even if you use the average value, adjusting it with a fast roll will still make things more thrilling. Something like roll a d6, if it's even the treasure is smaller than average, if it's odds it's larger, and a d100 to find out the percentage of the increased/decreased value. The really dramatic roll in those treasure tables is the chance for magic items (and their nature).
A Wider Perspective
Randomly rolled treasure are integral to the "by the book" game experience: the game where you follow all the rules has a chance for you to live the story of the outcast freak with no score above 11 who somehow got a sentient sword and a flying carpet during his second session. The more you exclude random from the game, the less chances it has to surprise and entertain you as a group.
And a Different Take: Random Treasure as a Story Tool
Rolling for treasure should never be done during play: the Referee really needs to know if the goblin king possesses potions or enchanted gear, because he sure is going to use them in battle.
So, rolling treasure and accepting the result can be an awesome starting point in designing your adventure or dungeon.
Zero treasure might mean a lot of things, and all of them can expand your scenario beyond what starting idea.
Someone more powerful extorted it for protection: a dragon, for example! Or: a more powerful dragon!
Someone cleverer stole it (and poor goblin king might still be unaware of the theft!).
It was all spent to fuel a specific endeavor such as a war, crusade, journey, construction, ritual, peace treaty, or dowry.
In other words: the treasure isn't there because it's somewhere else! And finding out about it and getting there might very well be the party's next adventure.
What about lots of treasure? That might be the sign of a very clever creature. One that is not like the rest of its keen. Your goblin king has a businessman attitude, or powerful allies, or a generous patron, or is more powerful, or has studied magic! Or it might just be a bunch of gobbos who stole from their king and are now on the run. The big question here is: where has that treasure come from? Whose gold was it? What are they going to do about it? Here's a hook for a quest, or the input for adding a second faction of monsters in the scenario.
Magic items further shake things up. It is not just the old "give the gnoll boss the axe +2 you've rolled". The axe +2 is the type of item the gnolls get when you pick treasure manually. Now consider this: you've just mapped and stocked your run of the mill orc lair. But then, boom, you roll treasure and they get an Elemental Summoning Device, Efreeti Bottle, Horn of Blasting, or Drums of Panic! That's no longer the raid-the-dungeon scenario you were designing: that's a cooler one, where those orcs are up to something bigger, subduing other humanoids and boldly raiding villages with their special toy!
The ogre who put the Helm of Alignment Changing on is now held prisoner by his clan, and might become an ally of the party.
What about a Sentient Sword popping into the kobolds' hoard you've prepared as your very first dungeon? Just remember that Bilbo got the One Ring from a bizarre random encounter while in a cave. Let the thing shape your campaign. Think of how it got there, what's its goal, and let the rest of the campaign surprise you*.
*works better if you have an actual campaign world outlined. I should make a post about that.