This is a good question. There are many purposes of art. Let me mention a few of them.
First, art can be a powerful means to express deep truths. This can cause a society to rethink things and grow. This is one of the most important functions of public art. Think of some of the art that was created in response to 911, or even the 911 memorial and museum. All the tragic loss of life shows that we live in a broken world.
Second, art can heal, because there is a sublime character to art. To use the 911 memorial and museum once again, many family members and loved ones of victims of 911 expressed that they felt a sense of closure and a healing. Both of these are valuable benefits of art.
With these things stated, there is also downside to art. We live in a pluralistic world. For this reason, art will be expressed and perceived in different ways. Hence, there will be different responses. In the end, not everyone will be happy. But this is life.