Such staircases are pretty scary to climb even without a knight attacking you because there is nothing to hold, the steps are not flat and it is easy to fall down.
Also, such straicases are used not only in medieval castles. A modern Russian 19th century cathedral also has a staircase of such type. Probably, because cathedrals must be built using traditional architecture?