That is a funny question. It is like asking: what is the evolutionary advantage of a broken leg? Sometimes things go wrong and the result is pain. There is no purpose to it; it just happened. Not everything has an evolutionary purpose.
My wife has Ehlers Danlos Syndrome, resulting in malformed collagen throughout her body. As a result, her tendons are too stretchy and don't work well, and so her bones don't align as they should, leading to wear and tear on joints and now incessant pain.
Also, many kinds of failures show up after the typical reproductive window. There is little evolutionary pressure to prevent such failure mechanisms.