Use real-world maps.
If you're really interested in verisimilitude, you can look at floor plans from the internet. For example, if I wanted to make a manor, I could do a bit of googling and find a floor plan like this, which looks like it could make for a decent house-based dungeon crawl:
Alternatively, if you wanted to have some ancient temple or tomb, you could look for similar things in the real world. The Great Pyramid near Giza, Egypt has a layout somewhat like this:
Sometimes stuff just doesn't make sense
When I plan dungeons, I sometimes try to make sensible dungeons, where each room has a purpose. But honestly, I don't feel like many people really care about that: I've never heard someone ask, "but what is the original purpose of this room?" Because you're ultimately planning for a game that is fun, "making sense" kind of falls by the wayside.
Depending on the kind of game you're playing, you have access to lots of things the real world doesn't. I've run a sprawling, multiroom dungeon with infinite floors before. None of the rooms make any sense from a usability or architectural standpoint, but my excuse was "a mad god did it". If you think a certain structure can be fun to play, you can just insert it and come up with a justification later.
Finally, if you want a real-world example of dungeon-like buildings that are full of real purpose and history but make no sense, look to the Winchester House in California. From Wikipedia:
Since its construction in 1884, the property and mansion were claimed by many to be haunted by the ghosts of those killed with Winchester rifles. Under Winchester's day-to-day guidance, its "from-the-ground-up" construction proceeded around the clock, by some accounts, without interruption, until her death on September 5, 1922, at which time work immediately ceased.
It looks something like this:
Doesn't that sound like a great place to run a dungeon?