The idea of diplomatic immunity is that it protects the diplomat / their family from being thrown in a police cell as leverage every time there’s a row between the two countries. Ie “Sign this treaty or we’ll throw your wife in jail.” So blanket diplomatic immunity is necessary.
It is traditional, and understood by all countries, that where a crime is committed that has nothing to do with politics (eg theft/assault), the host country asks the diplomat’s country to waive the immunity, and the diplomat’s country agrees. This is standard procedure.
The problem is, America has an attitude that all other courts/police are inferior to American ones and so its citizens basically shouldn’t be subject to the authorities of any other country. Whenever their people commit a crime abroad, they fly them out asap (usually on a military flight to avoid scrutiny) and refuse to waive immunity. It’s outrageous but similar to their stance on extradition.
Of course, they don’t apply this attitude when foreign diplomats commit crimes in America 🙄