You are biological creatures. Your proud human consciousness rests on the vast unconscious integrity of physical being. In terms of species integrity of your mental state is highly important. Despair or apathy is a biological enemy. Social conditions political states economic policies and religious and philosophical frameworks that foster such mental states brings about a biological retaliation. They act like a fire applied to a plant.
The epidemics then serve many purposes warning that certain conditions will not be tolerated. There is a biological outrage that will be continually expressed until the conditions are changed.
Epidemics by their public nature speak of public problems.
Quality of life
What makes a life worthwhile? Quite simple if life is not worthwhile no species will have a reason to continue.
Civilizations are social species. They die when they see no reason to live , yet they seed other civilizations. Your private mental state en masse bring about the mass cultural stance of your civilization. To some extent the survival of your civilization is dependent upon the condition of each individual. That condition is a psychic and a spiritual state that gives birth to the physical organism. That organism is intimately connected to each other living things.
No species compete with each other but cooperates to form an environment in which all kinds can creatively exist.
You live in a physical community but you live first of all in a community of thoughts and feelings. These trigger your physical actions. They directly affect the behavior of your body.
When a species overproduces the incidents of epidemics grow. This applies to human populations and to animal populations. The consciousness that became briefly physical is not annihilated but waits for better conditons.
Suffering is not necessary good for the soul and left alone natural creatures do not seek it.