Why should anyone have diplomatic immunity? If we choose to go into their country we are expected to obey their laws, just as they should when they are here, Why is there even such a thing as diplomatic immunity?
Diplomatic immunity has existed literally for thousands of years. How could any country send an ambassador to negotiate with a potentially hostile country if they had to worry that their ambassador would be arrested on trumped-up charges?
To prevent diplomats being taken hostage in the event of hostilities initially. Now, of course, diplomats use it to get away with crimes.