Dogs eat their own vomit because to them it's seen as a food source.
When pups are being weaned mother dogs will regurgitate food for their young to help them adjust to eating solid foods.
And gross as it may be to us vomit still smells like food, at least to your dog.