For we know that the whole creation groans and labors with birth pangs together until now(ROMANS 8:22)
It is so very sad when an animal dies—especially a favorite pet. And you are right; they don’t sin because they have no souls. But the Bible says that all things will die on earth because of Adam’s sin in the Garden of Eden. Let me explain. If the principal at your school said there would be no recess, it affects everyone at your school because he is the head of your school, right? Well, God made Adam the head over the earth. He gave Adam “dominion” or power and control over the earth. Since Adam was our first leader, everything he did affected everything on earth. We know that God told Adam if he disobeyed he would surely die. So, since Adam had to die because of sin, everything on the earth would also have to die. And that includes all the animals. It wouldn’t make sense to have sinful humans who would die when everything else around them remained perfect.
When our dog died, I was sad! But it reminded me how terrible sin is, and because of sin, everything and everyone must die. At the same time, I was joyfully reminded that because of Jesus Christ and His death on the Cross, the people who believe in Him would live forever with Him in heaven even though their bodies may die here on earth.