DS1 has been doing this too and we have worked out he does it when he is feeling a bit left out and wanting a bit more attention and cuddles.

The way we chose to handle it was to ignore it, calm him down and distract him. Has worked a treat every time.

Good luck.