Of course, there is no such federal or state law in Alaska, despite the Border Patrol Agent's claim. There have been many such abuses all across the nation. Fortunately, the legal system is catching up, and officers have been reprimanded, sued civilly and in some case prosecuted for these actions.
The ACLU recently clarified the right to photograph in public.
Taking photographs of things that are plainly visible from public spaces is a constitutional right – and that includes federal buildings, transportation facilities, and police and other government officials carrying out their duties.https://www.aclu.org/free-speech/know-your-rights-photographers
Police and Law Enforcement are constantly encroaching on the privacy rights of citizens by installing ever more surveillance cameras and utilizing other forms of invasive technology. Fortunately, police abuses of power can be photographed by every person with a smart phone to ensure they are on their best behaviour.