At KPMG LLP, prosecutors say, the revolving door spun out of control.

Starting in 2015, the giant accounting firm wanted badly to improve its standing in the eyes of its regulator. But when KPMG recruited employees from its overseer, a scandal emerged over leaks of confidential information that resulted Monday in the indictments of five people on fraud and conspiracy charges.

Authorities...