The developers of Civ3 considered adding dark ages to the game, but in the end they decided against it because they said it would be too "unfun". It's generally a no-no in game design to arbitrarily and unnecessarily punish the player, and it's particularly undesirable to punish a player for playing too well (e.g. getting ahead in science).
That said, I agree with you that there needs to be some sort of dark ages feature because imo it would enhance both realism and gameplay. But rather than having dark ages that either occur randomly or as a direct result of playing the game too well, they should be more organic and implicit. They also need to be part of a trade-off that can also impart benefits of some kind to the player.
What I mean by "organic" is that they should occur primarily as a result of how the player plays the game. This would likely involve a radical rethink of the whole structure and the overall theme of the game, e.g. making the game less about achieving arbitrary victory conditions and more of a sandbox-style game that focuses on standing the test of time.
To make organic dark ages, it is necessary to look at the causes and circumstances of historical dark ages. For example the European dark ages that followed the fall of the Roman empire were essentially the result of the collapse of a large sophisticated empire in that region of the world. In many respects the Roman empire carried the seeds of its own destruction, and these seeds started to germinate in Rome's glory days. In the end it was a complex interplay of internal and external stresses (mostly relating to the empire becoming too large and complex to expand any further and maintain itself) that bought about the empire's protracted collapse, thereby ushering in "The Dark Ages".
The point I'm trying make here is that dark ages should be a natural consequence of how you play the game: civs should always be trying to meet the challenges posed by pressures such as political stability, climate change, plagues, natural disasters, environment and resource degradation, foreign wars and barbarians. One option for meeting these challenges should be expansion, but if you try to expand too far and/or fast these challenges should naturally become more intense so that they overwhelm your empire and cause it to decline. Even if you don't over-expand but just don't do enough to prevent and protect your empire from these risks, this should still put you in danger of decline/collapse.
Dark ages should also be "implicit" in that it should be naturally apparent based on the ebb and flow your game that you are in a dark age, rather than actually having the game explicitly announce 'your empire is in a dark age'. If you start:
- losing cities and experiencing armed revolts due to political instability
- losing knowledge of already-discovered technologies
- getting overrun by barbarian armies and migrants
- experiencing land degradation and resource depletion due to overexploitation
- experiencing rapid inflation and financial paralysis
- losing infrastructure due to pillaging and natural disasters faster than you can rebuild it
- being more severely affected by famines, plagues, and natural disasters
- feeling compelled to keep increasing your bureaucracy even as it becomes increasingly ineffective
- being compelled to run civics which do not support scientific or cultural advance but have advantages in terms of defence, sustainability and social cohesion
then it should be clear that your empire is experiencing collapse and entering into a dark age.
A major advantage of not having the game explicitly mention dark ages is that the term "dark ages" has very negative connotations, even though the phenomenon they describe is not necessarily all bad. Another way to look at dark ages is to regard them as a natural and normal part of the life cycle of civilizations. I once read a very interesting article which proposed that the middle ages were actually a natural solution to the systemic problems of the Roman Empire; had the Romans seen the tide of history turning toward the middle ages and tried to work with that tide rather than fight it, much more of the ancient Western world's knowledge and culture - and perhaps even the Roman Empire itself - might have survived through late antiquity. So maybe in-game dark ages could offer advantages and opportunities for civs such as improved sustainability and greater cultural unity, particularly if civs had the option to proactively scale down their expansion so that they could improve their resilience (and thus their prospects of long-term survival) in the face of various in-game challenges.