It's normal and expected for the DM to make certain rolls on behalf of the players as a shield against metagaming. Perception-orientated skill checks are a good example; if you have the player roll Sense Motive and the d20 result is a 1, then the player knows that it's very possible that his PC has missed something. Offhand, Appraise checks, certain kinds of Forgery checks, Listen, Search, Sense Motive, and Spot all fit explicitly into this realm of concern. There also are instances where I guess you could make an argument that Knowledge checks also trigger this sort of issue. Metagaming based on the outcome of a check usually isn't a major issue in the games that run on this forum because we're all reasonably mature, experienced players and most of us go in for a sort of immersive roleplay experience, where we're inclined to ask ourselves whether our character knows what we know. But it happens sometimes despite our best intentions.
The easiest way to put a lid on this stuff is for the DM to make secret checks for all of these skills, every time, and then report the result to the players.
Let's imagine that the party is traveling through a bandit-infested forest. They have a specific destination in mind, and the path they're taking is the only way to get through the area in a timely manner. So it's guaranteed that they'll come up to a spot that would make a great ambush site. In a situation like this, the DM rolls Spot and Listen checks against the bandits' Hide and Move Silently checks, and reports whether the PC sees anything. Simple enough. And if the PCs are making their way through a dungeon, the party's rogue might decide to search for traps on a door that the party is obliged to pass through. Again, the DM would be the one who actually makes this check, and that way the rogue can't see that he rolled a 1 and decide that it'd be better if the party's barbarian kicked the door down.
I think of checks like these as "active" perception, and they're an important part of the game because they represent instances where the PCs are engaged with the game world in a very intentional way. You're looking for threats hiding in a specific area. You're trying to hide from people coming from a particular direction. You're searching for traps on this particular door. It's very specific and concrete, and these active checks are a major venue for the players' ingenuity and attentiveness to shine through as a source of advantage.
But in at least a few cases, I don't think these sorts of perception-orientated skills are a good model of what's happening. Let's say that the PCs are traveling through the same forest, and they randomly bump into those same bandits as the scofflaws are on their way to the ambush site. For the sake of quickly and easily determining whether there's going to be an encounter, this is where I use the "stealth and detection" rules from the DMG to set the starting distance for the encounter and determine which side notices the other first. Usually, I do this with minimal rolls; I take the least stealthy person/creature on each side, and use that individual's Hide/Move Silently modifiers as if that individual is taking 10. And then I take the most observant individuals' Listen and Spot modifiers and do the same, and figure out how close the two groups can get to one another before it becomes likely that they notice each other.
This sort of passive perception routine is good for reasons of its own. It covers the idea that an experienced adventurer is always, at least to some degree, paying attention to his surroundings. The PCs may not be going to great pains to be utterly silent or to move entirely under the concealment of undergrowth or shadow, but it acknowledges that in the ordinary course of events they are still on the lookout for trouble and doing their best not to draw attention to themselves. Nobody is going to be on high alert and looking for trouble behind every bush, fallen log, and stump on the landscape for a whole eight-hour period of travel, of course. But it's a good way of indicating that even when the PCs are phoning it in, they're still keeping their eyes peeled and their steps quiet. It works fine for Listen and Spot checks.
It doesn't work for Search checks, for a variety of reasons that I'll get into in a minute.
I was thinking about this while I was preparing a set of random encounters having to do with construction accidents, which I basically opted to realize as modified traps. Almost immediately, I realized that I really, really like the idea that in a tightly packed medieval-style city, a construction project being carried on without the auspices of health and safety regulations would be dangerous to literally everyone in the vicinity. Bricks would fall on people, workers would spill buckets of boiling tar all over the place, etc. Great stuff.
But I really don't like the idea that you'd need to be actively using the Search skill in order to avoid stepping into the path of a construction accident. That's unambiguously how Search works in the 3.5 rules (and in Pathfinder, it looks like this specific application of the Perception rules also is enforcedly an "active" check). We can tell that this is the case because elves get a racial ability to notice hidden doors with a Search check as if they are actively looking for one, and because dwarves get a racial ability make Search checks to notice unusual stonework, including traps and secret doors made of stone or made to look like stone, as if they're actively looking for them. Those exception cases make it evident that otherwise, Search is an "active" perception skill.
In cases like a trapped doorway that the PCs must pass through, that's really no big deal. That kind of scenario is an invitation to take a really good look at the door in case it's trapped, because obviously this is a good place to have a trap. And it's also pretty clear that this would be a good spot to have a secret door or other way around the trap. So it's not really a big stretch for the players to say, "okay, well, this looks like a good time to search for traps and hidden doors. Let's just get this whole room."
But it kind of sucks if the trap in question isn't in an obvious place that invites a Search check. For example, if you have a 100 foot long hallway in a dungeon somewhere, you can just slap a hidden pit trap someplace randomly along the length of the hallway, and unless someone makes a Search check at exactly the right spot, the only way to find it is to fall in. If the DM chooses to use such a trap, the players are going to start searching every single 5 ft. square in the whole dungeon. And the DM will deserve it when they do. This would radically alter most games' pacing, because all Search checks take a full round action per 5-ft. square. Navigating a 50-foot x 5-foot length of hallway would take a full minute if the party's rogue only searches each square once. If the PCs get really paranoid and start taking 20, it's going to take two minutes per 5-ft. square. Which is to say that a particularly cautious group of adventurers might spend an hour to cover a distance of 150 ft.
Similarly, using the trap mechanics to model a random "construction accident" in an urban setting has a lot to recommend it in terms of ease of use, logic, CR assignment, etc. But it's kind of dumb to assert that people need to be making Search checks in order to avoid tripping over a rope that will cause a bucket of hot pitch to fall over and splatter into the crowded street below.
I see a few options for possible house rules or variants to Search checks having to do with traps. First, I think that it's important for us to understand that the Search skill does more than just handle traps. It's also used to find secret doors and compartments, and it's the skill that reflects a character's ability to rummage through a filing cabinet, chest full of random items, pile of trash, or some other collection of stuff and find a particular thing that is useful or valuable. Finally, it's the skill that you use to find footprints or other signs of a creature's passage (basically, to find clues). So it really has four different applications, and I personally don't have any quibble with how it works for finding secret doors and compartments, or with its functions as a means of unearthing clues, or to dig or a few gold coins or a magical ring out of a pile of refuse. I'm focusing specifically on Search as a means of noticing that there's a trap (or other hidden danger that isn't a creature) that might do harm to someone.
One way to smooth out this issue is to adopt this house rule:
The DM makes secret Search checks for all characters who pass within 10 feet of some part of a trap. If the character's Search result exceeds the Search DC of the trap, the character notices that it is there. Search checks for this purpose, like most Listen and Spot checks, are not actions, but instead represent a character's ability to perceive his or her surroundings in a reactive manner. Note that difficult traps (those with Search DCs higher than 20) still are restricted to characters with the trapfinding class feature, or to cases applicable to the dwarf's stonecunning ability, or to similar class or racial abilities. You can't take 10 on a Search check to notice a trap. Actively searching for evidence of a trap is a move action.
Creatures who are distracted (e. g. by combat or some other activity which consumes their awareness) receive a -5 penalty to Search checks to notice traps.
Fascinated creatures receive a -4 penalty to Search checks to notice traps in a reactive manner.
If you go with this house rule, then there are some trade-offs. It greatly streamlines play in dungeons, which probably is a good thing overall because dungeons are really complicated in and of themselves.
Arguably, it also nerfs traps. I'm not terribly concerned about this because only rogues (and in an underground or predominantly masonry/stone environment, dwarves) can detect traps with a Search DC higher than 20, and this house rule doesn't make it any easier to disarm a trap. Most CR 1 traps have Search DCs at or below 20, but after that it's at least an even chance that only the party's designated trapfinders will notice a trap. I think it's probably worth the minor nerf to extremely basic traps because this houserule would make traps in general a lot easier to use in play without instantly sending the players and PCs alike into extreme fits of paranoia.
Finally, there's some basis for the argument that it nerfs the dwarf's stonecunning racial feature, because dwarves already get to make Search checks for free when they're trying to notice "unusual stonework," including stone-based traps. But I don't think that this is a serious issue; stonecunning is still a very desirable ability because it grants a blanket +2 to Search checks dealing with stonework, it still allows the free checks to notice other unusual stonework, and it still affords dwarves the ability to sense depth and find stone traps. If a player complained really bitterly about it, I guess you could bump the Search bonus up to +3.