If that corridor's just so important and held a very dangerous beast, why would they let it be opened just by simply casting an Alohomora?
The door is there for the students.
It's forbidden, move away.
Try to open it ? It's locked, move away.
Cracked it with a spell ? Here is a giant angry three-headed dog, don't forget to change your pants.
The door's purpose is only to block most students avoid them being hurt if they got curious, the real protections being behind it.