Heaven goes by favor. If it went by merit, you would stay out and your dog would go in. —Mark Twain
While you're alive, your dog is, legally, your property. Aside from the restrictions of neglect and cruelty laws, you can do almost anything you want with an animal you own: sell it, give it away, or have it humanely destroyed.
What about when you die? If your will directs the executor of your estate to have your dog humanely destroyed, and the executor or a local humane society doesn't object—quickly—the dog will be euthanized soon after your death.
If someone does object, the probate court, which oversees the administration of your estate, will rule on the validity of the will provision. Almost always, these provisions are found to be invalid, and the court may forbid the executor from carrying out your instructions. Courts have always frowned on wills that order the destruction of any kind of property, on the ground that it goes against public policy to needlessly destroy valuable property. (This prerogative, of course, isn't exercised logically or consistently: if it were, a court could intervene whenever an owner wanted a healthy pet killed, not just when the owner tries to do so from beyond the grave.)
Generally, the court's rationale is something like this: Someone leaves instructions in a will to eutahnize a dog because of the worry that the dog will not be cared for properly or will end up in a shelter or somewhere worse. The owner wishes to prevent pain and suffering. So, if the dog is old and ill, or so attached to the owner that it couldn't adjust to a new home, the owner's request that it be humanely destroyed may make perfect sense. But if an executor has found a good home for the animal, and the animal seems well adjusted and well taken care of, a court may decide that the previous owner's wishes are best fulfilled by not carrying out the will's order.
For example, a court faced with a will provision ordering the humane destruction of two healthy Irish setters concluded that the owner wouldn't really want them killed, because the dogs were happy and well cared for in a country home: "There is no lack of care. There is no reason for carrying out the literal provision of the will. That decedent [the deceased owner] would rather see her pets happy and healthy and alive than destroyed there can be no doubt." (Capers Estate, 34 Pa. D. & C. 2d 121 (1964).)
One state legislature, moved to action by the public outcry over the impending death of Sido, a little mixed-breed dog that was being temporarily protected by the San Francisco SPCA, used the same rationale to pass a special law to save the dog's life. The legislature found that the dog's deceased owner, "having the best interests of her pet dog in mind, would not wish her instructions for the destruction of the pet dog carried out" if she knew how happy the dog was now. (California S.B. 2509, signed June 16, 1980.) On the same day, a judge ruled that wills could not be used to destroy property. (Smith v. Avanzino, No. 225698 (Super. Ct., San Francisco County, June 17, 1980).)
Although courts rarely mention it, there is also overwhelming public opposition to carrying out such a will provision. It's hard to imagine a judge who wants to become famous for ordering the death of a pet that hundreds of families have offered to take in.
Many question the motives of dog owners who put such directions in their wills. Most pet owners who are truly worried about what will happen to their pets could arrange, if they tried hard enough, to have them go to loving homes. Obviously, there are exceptions: some dogs' attachment to one person is legendary, and such dogs can't be expected to adjust to new homes. The same goes for dogs that are incorrigibly bad-tempered around anyone outside the immediate family. And, of course, older dogs who are not in the best of health are not easy to place in new homes. But, unfortunately, there are times when using a will to order a healthy, normal pet to die when its owner does seems reminiscent of ancient rulers who had servants, wives, and animals buried with them.