Diplomatic Immunity was codified in 1961 at the Vienna Convention on Diplomatic Relations for a host of reasons. Among the reasons was to have an international standard in order that diplomacy be unencumbered by local authorities having legal authority over diplomats, leading to abuse and possible hostilities. It was also done to ensure diplomats not be abused by host governments during times of hostility. Of interest, Great Britain was one of the first counties to codify it in the early 1700s but the practice goes back centuries.
While it was almost universally practiced, it was not observed uniformly. For instance, after the Pearl Harbor attack, our diplomats were confined to our embassy in Tokyo and not allowed to leave the country; essentially being held captive until repatriated some time in 1942. We allowed the Japanese ambassador and his staff to return to Japan.
Diplomatic immunity is critical to the exercise of diplomacy but sadly many times abused, especially by UN employees in New York.
Excuse me. My BA was in International Relations-Soviet Studies and I sometimes it comes back. I am not trying to be tutorial.
In spite of the above, I still believe it was an extremely bad move to allow this gal to exercise diplomatic immunity and depart the country. At the most she would have been expelled after the police inquiry.