First of all because it is a regulatory requirement. Furthermore, not all wrongdoing are criminally relevant and can be reported to the magistracy. Denouncing to the magistracy implies that the illegal act has already been performed and therefore the conditions for prevention are missing.
The main purpose of Whistleblowing is indeed to prevent or solve a problem internally and promptly, and give the possibility to report a wrongdoing using a highly secure and confidential tool. Moreover, several wrongdoings are susceptible to precautionary disciplinary actions that the public administration must undertake jointly with the respective report to the competent judicial authority.