Not all RPG systems are suitable for all adventure types at all levels. It can be tempting to design an adventure, especially for a high level or well equipped party, and place artificial restrictions on the party in order to make the adventure "work." This is to be avoided if at all possible. The characters, and their players, have earned their abilities and equipment and they should not be removed without a great deal of reflection.
Fantasy wizards, at mid to high levels, have an amazing slew of abilities at their disposal. They can detect alignment. They can read minds. They can pass through walls. Imagine attempting to design a dungeon to handle someone like this, someone who can dissolve stone in order to tunnel between rooms, avoiding all of those hallway traps you placed. Or an investigation adventure in which the party can read minds, talk to the dead, and detect alignments and deceit. It can be tempting to limit these powers. Amulets of Immunity to Detection. Wish spells cast on the dungeon walls to prevent tunnelling through them. I'm sure the analogues in other adventures are obvious, such as spaceships with hulls that sensors can't scan, or Yet Another Computer Malfunction. These are among the hallmarks of a poorly designed adventure.
Generally this means the adventure has been designed for the wrong power levels. If you want to keep the fantasy party from dissolving the walls through magic then the adventure should be written for a level range in which the party doesn't have access to that spell, or perhaps only one or so of that spell. Likewise, investigation adventures. If you don't the wizard running around casting speak with dead then write it for a level that speak with dead is not available. Turning to techniques such as "the spirit hasn't completed its travel to the afterlife" or other mechanisms to limit the spells, does nothing except communicate to the party hat their hard work was useless and can arbitrarily taken away at any time on a whim.
There are other techniques to turn to in order to solve these problems. Writing an adventure for a lower level party, or a party without as much equipment, is one technique. Another technique is to leverage the social element. The party COULD [speak with the dead, nuke the site from orbit, read minds, etc] but what are the social implications of that? Care must be taken to not punish the players for these actions, but rather have some natural follow-ons to nuking the natives of planet Cestus-9. Thus the players get to make a choice: limit themselves or accept the Easy button in return for some consequences later.
An analagous problem if with items use dbythe opposition. Thee's a tendency to create super powered that can only be used ... no, put that in magic items maybe?
And no, you can't give your skeletons amulets that make it harder for the party priest to command them to leave. Just because Gygax jumped off a bridge doesn't mean you should.
[Something about D&D being written for dungeons and the 4 hour workday and its applicablty in a footnote]
What sucks is that players usually choose the abilities that let them bypass stuff because they believe it will be cool and make their character useful. Gimping them robs them of the fun of "solving" a problem using their flashy new power, which was the whole reason they chose it in the first place.
Good design tip: if you're making an adventure for characters of a certain level where they have the ability to turn vampires or use passwall or whatever, it's bad practice to make anything in the adventure hinge on their inability to use their ability (like making the main bad guy a vampire, or protecting the treasure with a basic wall). Instead, I like to throw opportunities for characters to use those very same abilities, because I know it's exactly why the players even chose to have them in the first place. All it takes is some tweaking. Like if I decide that a murder mystery would be completely blown by a simple speak with dead spell, then instead of saying "speak with dead doesn't work", I simply make the information revealed during the spell to be different but still useful (ie. the victim doesn't say "Bill did it", he says "I didn't get a good look, but I saw a ruby ring on a finger").