veterinarians are the most realists people in the medical field. While you put cost as the main factor my experience it is not simply a math problem, it is often a quality of life issue. Spending the $10,000 to extended a pets life for a another year is rarely about making the pet better, it is emotional support for the human companion of the pet while the pet will end up suffering for the year and die anyway.
So yes it is often cheaper to humanely put a pet down, it is often also the most ethical thing do to even if money was not a factor.
I call them realists because the face the inevitability of death head on in a way that we do not do in Human Medicine where we believe maximization of chronological age is the singular goal to be achieved at all costs with no regard to cost, pain, suffering or quality of life.