Fusangite, ability to sleep is not an issue. A 3.x edition spellcaster's daily spells are daily spells. You don't prepare them every time you rest. You prepare them at most every 24 hours, and you have to rest beforehand.
You can't prepare your spells at 8 AM, fight until 10 AM, rest until 6 PM, and then prepare them again. You'd have to sit down until it's 8 AM again, at least. Also, preparing spells takes one hour, so when you rest you rest for 9 hours at least.
As for resting in a dungeon... imagine breaking into a military base, guns blazing, killing off a bunch of soldiers, blowing up a humvee or two - and then picking a random room and expecting not to be disturbed for 9 hours. That's so absurd it doesn't even make sense.
In any inhabited place, people are going around all the time and you'd have to look pretty hard to find a place where six people could stay for 9 hours without being discovered. Especially if they have made their presence known.
Now, some dungeons are so huge and sparsely populated that one might actually be able to stay for a significant length of time without being found; and some parties are so good that they can actually kill off a third of the place's inhabitants without the rest noticing for many hours. Some dungeons are populated by non-sentient creatures, who won't usually actively look for the PCs until they are personally attacked or unless they just happen to stumble onto them.
But in the majority of cases, the "interruptions" in a hostile enemy base would be measured in minutes. Resting in a dungeon with a significant number of hostiles is simply nonsense. Can you picture a burglar breaking into your house while you're in the bathroom, shooting your roommate, and then sleeping on the kitchen's table for 8 hours without you noticing anything?