Ok, as movies are edited, (forget the shooting) certain choices are passed on to the editor. In this case it might have been Friedkin’s decision to have this recurring noises over the scenes you talked about.
Reason for it,
It reminds the viewer of things to come, related to the past.
When you see the one eyed man along with the fierce fire next to him, all presented with the hammer sounds; It’s an obvious attempt to recreate some sort of hellish atmosphere.
When Merrin receives the letter and you hear the sounds, it allows you (the viewer) to have a more solid idea of what is going to happen in the future.
Taaadaaaa!
yours truly
Kindy