I've acted as a carer and also had close contact with those with terminal but debilitating diseases that cause, close to the end stage, lots of pain, confusion and so on (and held the dying). My own stance does not rely on religion (because I don't have one) but even so I don't have all the answers as I think each case is so individual.
I don't see any religious reason not to allow euthanisation. However, I am aware that it needs a very tight framework to ensure it is used appropriately. I also know from veterinary sources of mine that euthanasia is often very hard on those who have to administer it, regardless of how bad an animal is suffering. It is given under appropriate circumstances but many vets still find it traumatic to take a life; they know the circumstances under which it is necessary and do not want to prolong pain but still feel for the death, the loss. Therefore, although many want euthanasia options for human beings, one still has to consider that putting it in place could lead to emotional distress to the doctors who have to administer it (and that may also have association with each individual's religious and moral belief systems).
Usually with animals, we do not put them to sleep when they no longer have their "personality" (unless they turn very aggressive) but usually it relates to their physical issues - pain levels through injury or disease and their quality of life relating to a more physical aspect. With human beings we also have that but we also have decisions on whether or not the person, the being in the body, is still there - have the brain centres become so damaged through disease or injury that the "personality", the thing that makes the person who they are, is no longer present? It's also the individual's frustration as they know less and less of the "who" is with them until it may even have gone.
I have no idea what my decision would be for myself or a loved one other than I wouldn't be against it but it would have to meet certain criteria (pain levels, their wishes, possibility of recovery - given medical leaps, levels of suffering, is there a way not to euthanise but to give substantial pain relief, how much time is left before a more natural death would occur anyway).
It's one of those huge, vast areas and I don't think "one size fits all" can apply very easily.
When the wind blows, watch the clouds...