The best argument in favor of diplomatic immunity is that there could not be diplomats (at least not in countries that might be hostile in some way) if there were no diplomatic immunity. Think of diplomats from the United States. If there were no diplomatic immunity, it is likely that the US would be very wary of sending diplomats to places like Egypt or Pakistan. There would be too much danger that the diplomats would be held by the local government on trumped-up charges simply as a way of trying to put pressure on the US. Or they might be held just as a way of expressing anger at the US. In such a case, it would be likely that the US would stop sending diplomats to many of the places where they are needed most urgently.