Dogs die for the same reason that humans die. They were not designed to live forever.
They live long enough to ensure the survival of their species, and then they die.
If you look at virtually all species on this planet, they typically live long enough to produce enough off spring to ensure that their species goes on. If they didnt do this, they would go extinct, as have many millions of species throughout Earth's history.
If you look at the particularly long lived species of animals on this planet, they either produce great numbers of off spring that have very little chance of individually surviving, like sea turtles, or they reproduce very infrequently and devote an incredible amount of energy to each individual off spring, like whales.
But in the end they all die. They live long enough to do their best to make sure their species doesnt die out, and then they die themselves. That is the nature of life on this planet for all lifeforms.