The general purpose of life is ultimately to be good, which includes true love. The specific purpose of your life is something you find that corresponds to the general prepare. Now the immediate purpose that aids in both of those is to grow.
Unless you are alive, you cannot change. At least that is the philosophy I've interpreted from Thomas Awuinas, Aristotle, and Buddhism. So the purpose of life is to change. Now if we are idealistic in thinking everything has a positive purpose, then life is so that we can change positively, that is to grow. And this purpose covers both physical and spiritual growth, though some philosophies will argue that the spiritual growth is the primary reason.
You might wonder if this means those who cannot grow therefore do not have a right to live. This is not the case as they still maintain the right to be loved and their life brings about many opportunities to love. The moral growth of people who take care of the infirmed and handicap is far superior to those who do not have the opportunities to show this love. Remember that no action is to oppose our purpose of loving, and that means every single person. Otherwise we venture into the realm of selfishness in which we are bound to choose evil.
In the original Spider-Man movie, the Green Goblin gives Spider-Man a choice between saving his love and an elevator full of children. His choice? Save all of them, even though it leaves himself vulnerable to the attacks from his enemy. His choice is instantaneous and he pulls it off thanks to the people of New York. It's not a question of numbers or even status. Every life is worth saving because our nature of love has declared it as so. And if we die in the process of saving others, then we have fulfilled our general purpose of love.
It may sound counter-intuitive, but perhaps the people who need to live the most are the ones who are the most evil. While we certainly need the ones that are good heroes, it's really the wicked that could use the inspiration and opportunity to change. If you believe in a heaven and hell, this is especially true, which helps explain why some religions advocate for abolishing the death penalty.
Life is extremely precious, but in order to understand why, we must the various purposes it has. It's ultimate goal is to be good, the individual goal is the specific purpose that you as a person can fulfill to aid being good, and the most immediate goal is to grow. This purpose of growth stems from that we need to live in order to change. We will change until we die and whatever our state is then will be how we will be for eternity.
N. D. Moharo