I think that each person has to decide what to do, based on their finances and the pet's age and condition. If the operation will fix everything so they can live a long and happy life, and you can afford it, then I would dfinitely be in favor of doing the operation. In my case, the $5000 is about my yearly SS income; and they usually want the money right up front; so it literally would not be a possibility for me, no matter how much I wanted to have the operation done. If I were in a financial position to do it, I would not hesitate to have the pet operated on as long as it would be better for him than having the pet put down. If they are only going to live in pain afterwards and then die anyway, it would be a hard decision, but probably better to have them put to sleep rather than prolong suffering.
As far as all of the starving people in the world being a better place to give money to; that is true, but they were all starving before the dog got hurt, too. So, I think that since you can afford the operation , then that is absolutely the best choice to make in this case.