So it’s not involved in a criminal investigation. Then it’s a loyalty test. Specifically, it reassures them you can keep a secret.
It's just the political loyalty that's a bad requirement.
The cabinet is chosen to implement the President’s policies. It would be odd to select for people opposed to the policies or those would actively try and stop them through leaks.