This quote means that instead of living a life without purpose or meaning, it would be better to die in a way that has purpose or meaning. For example, the quote might be a reference to a soldier who dies for their country in battle, or someone who puts their own life in danger to help another person. In either instance, the death would have meaning, whereas a life spent in a meaningless way would not be as desirable.