Hello and welcome to the boards.
A few thoughts to add to what has already been posted:
1) In medieval times, prisons were not really a thing. Only really high value individuals were "imprisoned" in general, and only until a ransom was paid. As these individuals held for ransom were usually high status they were kept in castles, often in fairly nice comfort, not in a dank dungeon space. Unless, of course, you attempted to kill a monarch in which case you might be held in a dank dungeon space, but only long enough for judgement of death to come down, and then out to the axe-man or hangman you went. For most crimes you either paid a fine, faced some form of corporal punishment (the stocks, branding or maiming), or faced the death penalty. So, if you are running this in a pseudo-medieval world you may need to explain why the prison exists.
2) To prevent boredom in the campaign I second much of what has been given to you already. Keep in mind as well that perhaps there are only 1 or 2 additional sub-basements to the complex. The additional adventure might come from the PCs discovering that monsters keep infiltrating the basement (and moving up into the prison itself), because something cracked open and attached itself. This might be the Underdark, catacombs, slime tunnels, or any of the other great options given. Perhaps some of the PCs work is helping close this entrance once they report about it (or they don't report about it and plan their own escape).
3) Related to Point 2, digging through earth and bedrock is really hard in a non-industrial world. Magic makes this easier in D&D land, but even then people will usually go with the cheapest and easiest option to build. One or two basement layers maximumm and in many cases no basement, since why dig down when wood is cheap to build up. The only big exception in the pre-industrial world to digging down being undertaken on a large scale is when there is something really valuable to obtain. Think mines for valuable ore, or salt. So perhaps the prison is partially built on an abandoned mine that was thought to be played out (but maybe is not abandoned, or played out, or both).
Good luck with the adventure.
Cheers
