Hi,
Unethical Behavior and Its Consequences
In a nutshell, unethical behavior resulted in an unethical separation!
You haven't shared detailed information. In what way did the employer's business get impacted?
Your friend lost the job due to his unethical behavior, whereas his employer might have lost credibility in the market, and the productivity of the company might have declined, resulting in financial losses.
Employer Monitoring of Electronic Gadgets
Regarding your question, "whether the employer can spy on the electronic gadgets of the employee," it depends. If the gadgets are provided by the employer, in certain countries, it is legal for the employer to monitor. Under U.S. law, any device given to an employee by the employer is the company's property, and the employer has the right to monitor that device, including Internet traffic, GPS, and screen content viewing.
Without detailed information, I can't comment on whether the employer can be challenged for this.