You're seeing one of the classic military ideas play out in your game — control of chokepoints. As many other people have pointed out, the advantage to controlling a chokepoint is that you can step back and force the enemy to push a narrow front of combatants against a broad base of defenders — so the person coming through the door is taking the most attacks.
Obviously, though players (somewhat) tend to be better disciplined than most people were in real life — players are not going to rush their characters through pushed on by adrenaline and machoism to face multiple attackers, but probably back off and attempt to attack at range. This is assuming NPCs with little planning or expectation to be fighting indoors — but if they are? The game changes drastically.
Buying Time
NPCs fighting defensively are often buying time until reinforcements can be summoned. This means they can focus on defense, since their goal is to stay alive and keep the enemy occupied until help arrives. This may also involve using some kind of push or shove action to push the enemy back and slam the door shut. Or, maybe tripping and knocking down the enemy so their allies have to step over them to get to you.
Alternatively, they may choose to retreat from the door, throw down caltrops, or knock over an urn of burning coals, etc. and retreat to the next defensible doorway or position. Knocking over furniture to block the path might also be a worthwhile choice.
If they've already notified the reinforcements, there may be a hidden ambush in the next room, or a lot of crossbow wielders all basically waiting to see what non-ally tries to get through the door.
Or, if there's a way for the reinforcements to loop around the party's rear, they may do that, instead.
Pulling out the Wounded
You have a line of combatants. Behind them, are their replacements. When someone is wounded, an ally pulls them back and shoves them to the rear, while another person steps up and fills the gap. This requires well trained troops used to formation fighting, although, by usual D&D mythos, hobgoblins are pretty organized fighting units, so this would make sense.
Although in D&D there's no real wounding or ability loss until one hits 0 hitpoints, it might be worth remembering any surviving hobgoblins can report back intel on the group, and they can plan better — who are the spell casters? What kind of fighting styles does the group use? This is even more important when you realize that the enemies will start bringing countermeasures in tactics and defensive tools to help deal with the enemy.
Indoor Weapons
Spears are not universally good indoors, but they can make controlling a hallway or doorway a very viable option. In real life, you can get many spears lined up, two or even more lines of troops aimed in a small space. If you're using the grid rules in 5E that is more limited than real life options, but still doable.
Darts and crossbows are pretty great indoor weapons for ranged options. Short bows might also work too.
Defensive Architecture
A lot of castles throughout history had arrow slits — small openings in the walls so archers could shoot through at intruders. These mostly lined the entranceways near gates, though dungeons might have them in other places. Of course there's gates that fall shut, barred doorways and a lot of options along those lines.
There might be areas with traps that can be activated by levers or pressure plates, and the bad guys will try to steer the characters into them, or at least, use the threat of these things to slow them down and keep them at bay.
Magic and unusual options
D&D being D&D, there's a lot more options beyond what you get in real life. There's obvious spells to create webs, walls, or lock doorways, but there's a lot of other ways magic can become very tricky.
- Summoning a swarm of bugs or rats to crawl (over, around) the party in the doorway, and attack or at least disrupt spellcasters.
- Using darkness, or an illusion to make it look like the enemy still threatens — while they've actually retreated from the doorway and are making their way to somewhere safer.
- Grease spells on stairs, or narrow walkways.
- Illusions of floor hiding pitfalls, making closed doors look like blank wall space, etc.
Best Answer
Size and Reach
Simply stand in things’ way.
You should definitely be using a reach weapon (guisarme is most popular for its tripping property). All other options pale in comparison to reach: other two-handers hit only slightly harder (barring mounted lance charges, but then you’re playing a rather different role than tank), and a shield is actively bad for you (because more AC means more reason for enemies to attack someone else).
If you have even 12 Dexterity, Combat Reflexes is worthwhile, and Improved Trip is not a terrible idea by any means (if you consider levels cheaper than feats, consider two levels in barbarian: the wolf totem can get you Improved Trip without Combat Expertise or needing 13 Intelligence).
Aside from a reach weapon, crusader doesn’t have any native way to increase reach or size, and feats and items rarely offer the option, but if you can do it, it’s very good.
Inhuman Reach and Deformity (tall) are expensive (two feats each for an extra 5 feet of reach), and have some problematic fluff considerations (Inhuman Reach requires Aberration Blood, and Deformity (tall) requires Willing Deformity and an Evil alignment), but reach is worth it if you can fit them in.
A dip in psychic warrior or war mind, if you have half-decent Wisdom, could get you expansion, which would help. Practiced Manifester can give you a bit more ML with it.
I have often considered Cloistered Cleric 1/Barbarian 2/Psychic Warrior 1/Crusader to be just about the best tank platform in the game. The barbarian and psychic warrior get you feats and expansion, while cleric gets you Knowledge Devotion for a decent accuracy boost, and Turn Undead and domains give you a lot of options. Plus hey, a few times per day you can use identify without spending money.
Tactics also warrant mention here. If you can hold a chokepoint, you don’t need to be big to be in enemies’ way. To a certain extent, friendly spellcasters can try to create chokepoints for you to hold; in some situations, may actually be better to leave enemies a narrow opening (that you’re standing in) than to wall them out completely.
Buff your allies more than yourself
Options like iron guard’s glare, defensive rebuke, and others make you a more inviting target than your allies. There aren’t a lot of options for this, but you have to be careful not to make yourself too good a tank – then you’ll just be ignored.
Song of the White Raven is an excellent feat. Bard is another excellent option for you.
Make yourself impossible to ignore
The best defense is a good offense – force your enemies to attack you by punishing them for ignoring you. Strikes are good at this with minimal extra investment.
Healing also works pretty well for this; if you can heal sizeable amounts of others’ damage taken, they’ll have to get rid of you to get anywhere. Crusader is a rather-good HP-healer.
Limit spellcasting, especially teleportation
Mage Slayer is a pretty good feat that prevents spellcasters from casting defensively. Magic Item Compendium also has +1 weapon properties that dispel buffs or prevent teleportation, which are very useful for you.
Having your own teleportation is key, too, for positioning. Anklet of translocation is 1,400 gp for 2/day 10-ft. swift-action teleportation: you want this, and then you want backups of this. Consider using Martial Study to grab the Shadow Hand teleportation maneuvers (shadow jaunt, shadow stride, and shadow blink).
If you really, really need to force enemies to attack you...
Knight gets the test of mettle challenge at 4th level, and it basically forces one enemy to fight you and only you. Its DC is based on your knight levels and Charisma; at least one of those might be decent. The 3rd-level knight feature, bulwark of defense, is also quite good.
There is also the Goad feat, but it’s absolutely awful.