Let's first talk about adventure design. If you're hiding anything that's important to your story -- in other words, anything where the game would be worse if the players somehow failed to find it -- you need to make sure your adventure includes lots of ways to find that thing. There's an article about the Three Clue Rule that goes into this in more detail:
For example, let’s say that there’s a secret door behind which is hidden some random but ultimately unimportant treasure. Finding the secret door is a problem, but it’s not a chokepoint, so I only need to come up with one solution. In D&D this solution is easy because it’s built right into the rules: The secret door can be found with a successful Search check.
But let’s say that, instead of some random treasure, there is something of absolutely vital importance behind that door. For the adventure to work, the PCs must find that secret door.
The secret door is now a chokepoint problem and so I’ll try to make sure that there are at least three solutions. The first solution remains the same: A successful Search check. To this we could add a note in a different location where a cultist is instructed to “hide the artifact behind the statue of Ra” (where the secret door is); a badly damaged journal written by the designer of the complex which refers to the door; a second secret door leading to the same location (this counts as a separate solution because it immediately introduces the possibility of a second Search check); a probable scenario in which the main villain will attempt to flee through the secret door; the ability to interrogate captured cultists; and so forth.
Let me say that a different way: your goal in D&D is not to simulate everything that might happen with high accuracy and fairness. Your goal is to run a fun adventure. Solving problems is fun; giving up and going back to town because the character wasn't smart enough to solve the problem is not fun.
Having said all that, let's now assume that you really don't care if the players find the secret door, and let's actually answer your question. : )
You can avoid leaking map information to metagamers by using a much larger map than your actual dungeon. Most of the map area will be blank unexplorable space, so that the players can't tell the difference between secret room and unexplorable.
You should assign penalties for spending too long in a dungeon. Dungeons are dangerous places! Even if the players have cleared all the encounters on the map, there can still be wandering monsters -- or, there could be more monsters trying to move in to the newly cleared dungeon. If the players take too long searching, they should encounter monsters which they have to fight.
The players might also be on a deadline if they want to return to town before nightfall.
If you haven't assigned any penalty for spending time, it really just makes sense for the characters to spend some time searching a dungeon, regardless of metagame information!
You've also asked about using metagame knowledge against monsters. I'll echo YogoZuno's excellent answer:
If characters display knowledge about specific monsters that you don't think they should have, ask for a Monster Lore skill check. If they fail the check (or are unable to make the check, due to not being trained in the appropriate skill), then inform them they cannot take that action.