I've noticed a friends dog doing the same thing you describe licking the carpet as well. It might be because the dog is trying to remove the taste of throw up in his mouth.
I know that when I'm about to throw up I get a bad taste on my tongue and in my mouth before I actually throw up.
That could be the same with the dog. He could be just having a bad taste in his mouth and is trying to get rid of the taste of vomit.