If the purpose of the obstacles was to prevent anyone from stealing the stone, why would the broom that's required to catch the key stored in the same room? Why not store the broom elsewhere?
If you analyze it like that then why keep the vials for the potions, just keep huge containers instead,why keep the pieces along with the chessboard and so on.. I think the challenges conceived by each of Hogwart's professor was to keep the intruders out, but allow authorized people in
It's the book plot's analogy of Point-and-Click interface games. To give an excellent description of the concept from "Overthinking It"'s "Are You There, God? It’s-a Me, Mario!" (aka "Video Games Anthropic Principle") article:
In a P&C there’s a finite number of obtainable items in the world and limited combinations of or uses for items that will actually do anything. The trick is getting the right items and then doing the right things with them to accomplish the task at hand and progress to the next puzzle.
The P&C gameworld is one in which there’s a place for everything, and your job is to put everything in its place. Meaning that each object you encounter is there for a reason, and has its own utility and purpose that will go unfulfilled until you activate it with your human agency.
As Joshua so excellently noted, every single task in SS is designed that way.