They like it - plain and simple. It's something in their nature to eat whatever they just purged because they know they need food for survival. Although your dog won't starve from not eating one meal, it doesn't know for sure it will get more food later.
When dogs throw up, it is partially digested food and therefore retains some nutritional value to the dog. If there were to be something that couldn't be digested that they have thrown up, they won't eat that.