Dying is only bad when it takes a long time and hurts so much that it humiliates you.
The remark distinguishes between death itself and the experience of dying. It suggests that death may be less frightening than a prolonged process marked by severe pain and loss of control. The emphasis on humiliation points to a fear not simply of physical suffering, but of being reduced by it and losing the composure or independence that a person values.
In For Whom the Bell Tolls, the thought belongs to a wartime setting in which death is an immediate possibility rather than an abstract idea. Characters repeatedly confront injury, execution and the prospect of being captured. The line therefore reflects an attempt to think practically about mortality under violent conditions. It does not present death as desirable; instead, it separates the inevitability of death from the particular forms of suffering that may precede it. The quotation centres on dignity, endurance and the fear of prolonged helplessness.