I don't have a problem with undercover cops doing police work. I do have a problem with people who are within the law being illegally mistreated by police. The existence of one does not need to include the existence of the other.

That officer should have allowed the journalist to continue filming. If the journalist was in any way obstructing the police work, she should have been instructed to move to a different location.