Surely they should just be put to sleep, no?
There are many criteria you could use for making such ranking of problems (a popular one is minimizing dollars per lives saved, or dollars per QALY added). Living in a free society means people are free to decide how much (if anything all) they want to spend on charitable causes, and on which ones. But in one's individual spending, it's worth to think about how to get maximum "bang for your buck", in terms of alleviating suffering.
---
[0] - By coincidence, this is on the front page right now: https://news.ycombinator.com/item?id=22993486.
Following this we could say: As there are always young able people in need, why care for old or disabled people who doo not contribute to society and only cost society's money?
Why "donate" taxes for care facilities and such unnecessary stuff?
There is an island on which there are hungry people and hungry dogs. There is a limited pool of donor funds.
The fact that there are people asking for money for the dogs before all the people on that little island have full bellies is just sad.
The dogs will feel no pain from being put to sleep.
Nobody can, will, or wants to even suggest that the children be put to sleep. We will let the children suffer horrible pain before we ever even consider suggesting such a thing.
So every dollar spent on the starving dogs is a dollar that could have prevented some pain for the humans there. It would cost no money and no pain to put the dogs to sleep and ease the pain of some children.
So stop trying to bring the rest of the world into this to win the argument. This is a localised problem on one island, and every dollar spent there should be spent on reducing harm.
By extension of your statement: Given that there are always people starving somewhere on Earth at all other points in time too, isn't it immoral to feed pets at all? They should be put down and that food should go to people! Dog food in general is immoral, because it could instead be given to someone starving somewhere.