Many laws were simply “imported” from the previous governments. This particular one is an anachronism left over from when Germany was a monarchy itself and most European nations had laws like this. The last time it was invoked was 1967*, and since then most Germans had forgotten that it even existed.
*it was the Shah of Iran, and the case was dropped.