There are conflicting reports on her diplomatic immunity and whether she was still employed as a spy (she was definitely employed by the US govt at the time, and as a spy in the past). So it's not as simple as saying she didn't have it or she lied about it. Looks to me like a complicated legal matter.
At least the US State Dept position is that she did have diplomatic immunity.
That’s exactly the point since otherwise there would be more opportunities for false flag attacks on, or by, diplomats overriding a non absolute immunity.
That might the point for some third world countries, and the US, which openly protect their criminals (usually war criminals) from justice.
With more civilized countries, the idea is that the person accused is still being tried, but in its country court, with the assumption that if they are guilty, they will get sentenced anyways.
At least the US State Dept position is that she did have diplomatic immunity.