In old-school RPGs, wondering monsters had several roles.
1) The most important role, IMHO, was to turn time into a strategic resource. Even if you carry plenty of supplies and torches, random encounters are pretty frequent in a dungeon, and thus wasting time means risking encountering monsters, some of them quite powerful for your level. So every action which takes significant time, risks a wondering monster roll, and thus requires a strategic choice on part of the players: should they rest now, that they have expanded 50% of their resources, and thus risk encountering something nasty while they sleep - or rather press on (or leave the dungeon to rest in a safer place)? Should they spend a turn doing a "take 20" search of each and every room in the dungeon, and thus risk encountering a monster, or try and notice clues in their environment? Should they kick down every door they encounter (thus making a LOT of noise and forcing an immediate wondering monster roll), or try to use discretion? Once time has a concrete cost in risk of encountering monsters, you reduce the tendency of players to resort to "15-minute adventuring days" and "take 20 to search everything", by making such actions into meaningful choices rather than routine acts.
2) Making dungeons, and deep wilderness, actually dangerous in-game. Peasants avoid the Accursed Moor because it is haunted. PCs who venture there - take a risk of meeting undead. Not just set-piece undead in barrow mounds, mind you, but random undead - after all, it is the Moor where the dead are reputed to walk. A nasty place. Not a place to tread casually through. The same goes with entering the Ghoul Castle of Doom - hungry ghouls abound there, and not just in set-piece encounters - the place is crawling with them. On the other hand, you shouldn't roll too often for random encounters in civilized areas - ACKS, for example has one encounter check PER MONTH in civilized areas. This strikes home the reason why peasants stay close to civilization and shun the wilderness - there are bad things there out to eat you, and you have to go prepared.
3) Making things interesting for both DM and players. A typical DM has a style - the kind of monsters and encounters he or she is likely to set up. A good random-encounter table goes beyond that - something surprising might turn up, and make the game more interesting It also pushes for encounters which are not "level set" to the PCs, and thus might necessitate something other than combat - maybe negotiating with the dragon who turns up in a random encounter and bribing him with treasure, or running away from him - not everything the PCs encounter is a balanced fight or even a necessary fight.