Undercover investigative journalism is an absolute minefield, legally and ethically, and in school we went over historical cases and the potential legal liabilities that were present.
Undercover reporters do not enjoy ANY of the protections afforded to undercover police officers, and indeed there have been recent high-profile cases of undercover sting operations by media organizations resulting in criminal charges.
For instance, in 2015 an anti-abortion organization called the Center for Medical Progress conducted an undercover investigation at Planned Parenthood facilities, and two members of that organization were later charged with 15 felonies in the state of California related to presenting fake IDs and "criminal conspiracy to invade privacy."
Edit: To clarify, I am not defending the actions of this group. I agree that they engaged in deceptive, grossly unethical behavior. I am merely pointing out that just because they claimed to be undercover journalists doesn't give them any legal protections. They were still able to be prosecuted and convicted.