The exact circumstances around the search—such as why CBP wanted to search the phone in the first place—are not known.
Knowing nothing makes it hard to know what's going on here, but unless there's a subpoena or court order, it can't be illegal to wipe your own phone. Not in a free country, anyway.
The report said Gach did not know why, even years later.
That's the article's only mention of "Gach," so wtf?
That's my guess, too.