I believe the sanctity of life should be valued over the quality of life. People can enjoy life regardless of their quality of life in many cases, unless their situation is so dire that it limits their abilities to enjoy life on a daily basis. For this reason I believe the sanctity of life is more important.
Yes, the sanctity of life should be valued over the quality of life, because the person should be allowed to decide whether they want to live. A person who is old should have their own choice whether to continue with feeding tubes or a breathing machine, not have that decision made by someone else.
If the quality of life is somehow deemed more important than the overall sanctity of life, we wind up in situations where lives might be ended or allowed to end because they are somehow judged as inferior or not up to par. Even if done with the best of intentions in individual cases, it leads to an overall pattern of potential discrimination.
When people bring up this kind of question, it begs far more.
Is it even a relevant question?
If you are speaking quality of life as in living a good and happy life, I can easily just say that the quality of life of a child is better if the child is alive, otherwise there is no life for there to be quality to even be measured.
Then of course we get into whose quality of life trumps whose (as I am assuming this has to do with either abortion or euthanasia).
For Euthanasia, if I am deciding for my own life, then clearly I should be able to make that personal decision. For abortion, the baby can't speak for itself, and people seem to think that the quality of life of the mother trumps the quality of life of the child, and make no course correction for the potential quality of life of the child, given that without a life to begin with, you have robbed said life of all possibility of any measure of quality.
If we value sanctity of life over the quality of life, we take away a person's autonomy (self-determination). We live in a society in which choice is a very high value, and valuing sanctity of life over the quality of life is very hypocritical. If someone has, let's say, Motor Neuron Disease, it's not our decision whether they have a quality of life or not. Quality of life is very subjective, and therefore can only be decided by the person in question. Stephen Hawking had a good quality of life, as seen by his scientific advances and his will to carry on. However, others may not see that point of view and therefore we cannot impede on their choice. It is wrong for us to prolong a suffering existence if the person in question does not wish to live it.
Let us suppose that there is a patient dying of cancer, and the disease produces a great deal of pain, but they can be kept alive by artificial means, This patient with terminal cancer, with no hope, is experiencing this pain for no reason. It serves nothing at all. Why should we elevate sanctity of life over quality of life when that road leads to more suffering.