In short, if you can't feel pain, or your pain signalling system is such that you might be reluctant to react to danger, then you increase your likelihood of getting harmed or damaged, which in turn lowers your chances of reproducing and passing that trait on.
So in other words, pain is supposed to be
unpleasant? And the very fact that we would like to eliminate it or otherwise avoid it, means that it's doing its job?
It's also interesting to note that biology tends to encourage us to do certain things with pleasure, just as it discourages certain things with pain. Two obvious examples are eating and sex. Since these two activities are essential for survival and reproduction, they tend to be considered almost universally enjoyable.
As was pointed out in Bill_M's Dawkins quote, nature in general is not particularly concerned with reducing our suffering. From that perspective, all that matters is our ability to survive and reproduce. Our "quality of life", as we define it, doesn't factor into this system at all. This is probably why there are many things that can cause us a great deal of discomfort and pain, even though our lives may not necessarily be threatened. You could say that this is nature's way of erring on the side of caution.