Prosecutors can use discretion for public health ends.

See the Joint Statement from Elected Prosecutors (US) in 2019 which refers to the use of discretion to further community health and well-being.

Excerpt:

As elected prosecutors, we are committed to protecting the safety and well-being of all individuals in our communities. We are also charged with protecting the integrity of our justice system and upholding the Constitution and rule of law. Fulfilling these obligations goes hand-in- hand. We know from our collective experience that when communities trust us and see the fair, equitable, and sensible exercise of prosecutorial discretion, they are more inclined to work with all parts of our justice system as we seek to promote safer and healthier communities.