I mean, it is better than letting them into the wild to possibly introduce foreign species into the ecosystem (see rabbit island, I also discovered a lizard island in Croatia while boating) or to die of starvation / hypothermia / dehydration.
I always see Facebook posts about someone finding a cage of pet rats / hamsters / guinea pigs / other animals near dumpsters or near the forest, with live animals inside, especially in winter after Christmas.
But hey, indirectly killing them is probably easier for ~~people~~ humans to stomach than directly sending them to their deaths?
I, myself, am sane enough to know when I can afford to have a pet, so there is a low chance to be in this situation, but if it came to it I wouldn't be against it - but only if it was either me or the pet.