This is kind of a pointless question imo. Animals are dirt cheap to feed, compared to the cost of adoptions and such. Yes you can get pets for free, if a stray walks up to you or something, but honestly the animal itself is the expensive part usually. If you truly cannot afford to feed a pet, you're probably so poor you'd be considering eating an animal instead of keeping it as a pet anyways.
The real question is what minimum standard of care is acceptable for humans to provide for their pets. Is it actually compassionate to take your animal to the vet, where they are scared? To have surgery done on the animal, even if it's lifesaving? The animal cannot consent so we are assuming that what we want is best. Same with end of life choices.
Edit: I was also thinking, consider the alternative for an animal at a shelter that no one is adopting. They either live in a kennel more or less at a no-kill shelter until they die, or they are put down. Compared to that, being adopted by a loving person and given a warm place to live, fed and sheltered, seems like a better life to me even if the animal eventually gets sick and put down instead of getting medical treatment.
The truth is that most pet animals don't really have any other place in modern society and given that context it seems like being a pet that gets just the basic comforts of life is always better than being a stray or shelter animal.