Bhagavad Gita, Chapter 4, Verse 8
For the protection of the good, for the destruction of the wicked, and for the establishment of Dharma, I come into being in every age.
The aim isn't punishment for its own sake, it's restoring what went out of balance.
Three purposes are named together: protecting what's good, stopping what's harmful, and rebuilding the underlying order itself. All three matter, and none of them is the whole point alone.