My son used to do this around the same age. Unfortunately for him, it started right about the time he got out of his doc-band. One of the side "benefits" of band treatment is that it protects your kid's H. from bumps. However, when the band comes off, they get an ugly wakeup call!
Anyway, I think he did it mainly because he wanted to hear what noise he could make. Banging his H. against the wall sounds different from banging his H. against the cabinet doors. And, banging his H. against the cabinet doors sounds different from banging his H. against his bedroom door.
It's just them figuring out the world around them and how their bodies fit within that world. Like one Mom posted, once they start walking, that'll distract them from wanting to do a lot of other things!