Why does my 4 month old puppy humps his bed like a maniac?

I already took one bed away and I gave him a low one (crate mat) now he's humping this one as well for the past 20 minutes. I took it away and he cried. The weird thing is that he bites it, and stays still with it in his mouth, and starts to fall asleep. I just touched it and it was so wet with saliva ewww. I am thinking he's teething and this feels good in his mouth? His eyes are watery and his beard too from all the saliva? He humps humps and stays still, humps humps stay still ... So weird!