The first philosopher to argue that each human being possesses inherent dignity because of being a rational agent in contrast with animals was Cicero in the 1st century BCE. Since then, the idea of unique dignity ascribed to human beings shows up in various philosophies (most notably in a moral philosophy of Immanuel Kant) and has become a foundation of human rights.
Many patients suffering from terminal illnesses become incapable of taking care of themselves and have to be reliant on other people or medical apparatus. For many of them, such a situation is irreconcilable with their sense of dignity and deeply humiliating; legal euthanasia is seen by them as a tool to regain their sense of autonomy. There is nothing dignified in a suffering without a hope of recovery. Forcing a person to live the remainder of their life being stuck in a hospital bed with a lack of power over themselves and in humiliating conditions (incontinence, constant pain, feeling themselves to be a burden for people around them) is inhumane and thus voluntary legal euthanasia is the preferable alternative.
The argument presumes that suffering is in itself undignified and humiliating, which is not necessarily the case; the concept of human dignity can be divorced from the capacity of self-autonomy and self-reliance on the principle of the sanctity of human life. Furthermore, this argument confuses the value of life itself with its quality, which taken to its logical conclusion could be used to justify non-voluntary euthanasia.
[P1] Each human possesses dignity unique to our species, based on self-autonomy and rational reasoning. [P2] The terminal illness and resulting suffering limits or outright makes self-autonomy impossible, robbing a person of their dignity. [P3] Therefore, the terminally ill patient should be able to regain his sense of dignity by choosing physician-assisted suicide.
Rejecting the premises
[Rejecting P2] Human dignity doesn't need to be dependent on self-reliance or the quality of life and cannot be made relative to the state of one's health.