I will start with a disclaimer: I don’t know why animals hiccup.
It turns out that I am not alone in that regard. Consultation with the ultimate reserve of human knowledge, Wikipedia, confirms that nobody knows the cause of hiccups.
What I do know is that younger animals, especially puppies, are prone to hiccups. (Human infants purportedly hiccup much more often than adults; however, since humans weren’t covered in vet school, I cannot claim to be an expert on the matter of hiccups in our species.) Hiccups occur less frequently in mature individuals. In almost every case, hiccups are harmless.
The intuitively named phylogeneic hypothesis theorizes that hiccups are “an evolutionary remnant of earlier amphibian respiration”. If that’s true, then hiccups may be linked to neurological pathways that are prevalent in young animals. The pathways are replaced as individuals mature, leading to decreased hiccuping.
It’s just a theory, but it’s as good as anything I’ve heard. Regardless of why it happens, most puppies outgrow their hiccups. Enjoy them while they last.