Hallways and corridors are of particular note when building an underground home. This is because, unlike with an aboveground structure, the hallways and corridors of a subterranean building are very solid checkpoints. Getting across from one part of the building to another without going through a corridor is far more difficult than with a more standard home, requiring a good bit of tunneling through rock and likely other materials as well. This makes corridors a nice security feature. Using some of the advanced construction available in Minecraft can render hallways of an underground base not only secure, but also trapped, impassble without permission, or even completely concealed from anyone who isn’t simply going around digging up walls for no special reason.
They also provide your protection against wandering monsters.
Since your character is only one block wide, there is rarely a reason to make your hallways wider than that. Since spiders are two blocks wide, this automatically protects your home against invasions from both giant spiders and spider jockeys. Also, since you are only two blocks tall, you generally won’t need to make your hallways more than two blocks tall- which immediately makes them completely safe from Endermen.
Long straight corridors are dangerous if you start finding skeletons in your base- they can only shoot straight, but their shots are dangerous and have a lot of range. Fortunately, you can either turn ths to your own advantage by becoming skilled with a bow yourself, or you can obviate the problem by building crooks and bends into your hallways to begin with.
Using corridors will also provide you some protection from flooding- extending the space between your rooms makes it far less likely that water or lava flowing into your base will spread into more than a single room at a time.
Hallways are, of course, also good for organizing things. It’s far easier to remember that you’re keeping your chests of cobblestone in ‘the third room on the left’ than to remember that they’re ‘in the room behind the room with the dirt, which has doorways into my bedroom and the room with the crafting table in it’.
Also, using hallways to space out your rooms keeps your base from becoming too cluttered, making them an aesthetic concern as well. It certainly doesn’t hurt that you can use the space afforded by a corridor to make a visual change to your base- shifting from stone at one end to wood at the other end can serve as a reminder to you that you’re approaching your library, for instance.
There is another reason I mention corridors as part of building underground, though. Digging out corridors for your base can serve as good practice for mining later on. If you can establish a rhythm for yourself when digging out a hallway, you can make the process much smoother and easier to maintain both when digging out new hallways and when mining for ore deeper underground.
Finally, the way you build your corridors is part and parcel with how your base looks as a whole. If your base is full of cobble walls and you plant torches on the walls as light sources, having a hallway with torches plunked down in the middle of the floor every so often will look at least a little strange. Similarly, building corridors lit with wall torches in a base where the rooms are all lit by glowstone will look inconsistent and disconcerting. Always keep in mind how other parts of your home look when you add onto it; it’s the space you’re likely to spend more time in than any one other location and having it look ugly or confusing does nobody any good.