Traps might be designed to make some sort of sense in the world, but they are really the ultimate expression of D&D being a game, not a world simulator or a story engine. Traps exist for essentially purely gameplay reasons.
So the function a given trap serves in the gameplay should determine...