D&D introduced character levels originally to distinguish heroes and legendary monsters from regular figures in Chainmail, who died after one hit. (This is why your "hit points" increase as your level increases.)
In future editions of D&D, the idea of levels supported the idea of a hero's growth. At level 1, an ogre was an incredible challenge. At level 3, an ogre was an exciting fight. At level 5, a handful of ogres is an exciting fight, but one ogre isn't much threat. At level 10, only a dozen or more ogres could really threaten a party of adventurers. A single ogre is no danger at all.
So levels still serve a purpose: As PCs gain levels, they become tougher against the monsters that they were challenged by before. DMs can highlight this feature of class-level games by threatening the PCs with an ogre at every level, until the campaign ends, at which point, they should be able to fend off a platoon of ogres. Of course, not every encounter should be ogres. But if they come up over and over as the PCs level, the ogre will get easier and easier, and they will feel like they're improving.
Is it bad not to offer this kind of continuity? Not really.
Having no continuity at all isn't bad; it just doesn't take advantage of the benefits of a level-based RPG. If every encounter is a new monster, then the sense of progress the players will experience from their levels is diluted. You'll get players feeling like you're moving the goalposts: I have more hit points and I do more damage, but the Cornugon is just as hard now as the Gelugon was three levels ago.
What about a 20-level game? Can the ogre be any kind of threat at all past level 8 or so?
No. You have to stop using ogres eventually. It sort of forces you to have the ogres no longer be a threat to the world after level 8 or 9 or so. The PCs have to defeat the entire ogre threat by then, or else things will get boring fast.
A tempting alternative is to level that ogre up. Suddenly the PCs are fighting vampire ogres; ogre barbarians with class levels (if you're playing Pathfinder); and ogre lords (the 4e version). They would start off facing Ogres as a level 3 battle. Then multiple ogres or single Ogre Barbarians for level 5 or 7. Then they see a mix of Ogres and Ogre Barbarians for 9, then a single Ogre Lord as a level 12 battle. Then Ogre Lords get mixed in with Ogre Barbarians, and then it's a dozen Ogre Lords as a level 25 battle.
This is a bad idea.
It's a bad idea because the sense of progress is gone. Every ogre fight is just as hard as the last one. That's even worse than no continuity at all!
So to take advantage of levels:
- Choose a non-unique monster to be a recurring threat; ideally a few levels above the PCs' starting level.
- Have the PCs encounter that monster over and over for about 6 levels - at least once per level, but not every fight.
- Toward the end, have the plot move toward an epic "End the Monster Threat" quest.
- Let the PCs end the monster threat.
- If you want to keep going, pick a new monster to be a continuous threat and introduce it either at the end, or as early as step 3, and repeat steps 1-4!