“They could hear footsteps, Filch running as fast as he could toward Peeves’s shouts.
“Oh, move over,” Hermione snarled. She grabbed Harry’s wand, tapped the lock, and whispered, “Alohomora!”
The lock clicked and the door swung open — they piled through it, shut it quickly, and pressed their ears against it, listening.”
- Harry Potter and the Philosophers stone
Why didn't Dumbledore bewitch the door to prevent Alohomora from opening it?
“And how are you going to get in there in the first place?' Harry was ready for this question.
'Sirius's knife,' he said.
'Christmas before last Sirius gave me a knife that'll open any lock,' said Harry. 'So even if she's bewitched the door so Alohomora won't work, which I bet she has -”
- Harry Potter and the Order of Phoenix