First thing i was chuckling about was that POTUS has an official photog and your friend did not have the rights to do any impromptu candids.
The nice policeman was simply enforcing the DCMA, and not blocking your access to public officials. I mean Obama is a rockstar so any pics taken of him may be commercially viable, and your bud is simply political papparazzi.
But realistically, it would probably be uber cautious law enforcer, who is thinking your bud could have easily pulled out a gun, or is using the cellphone to trigger an IED, while under the guise of taking a photo.
In my experience, in a lot of such situations, the cop knows perfectly well there is no law that stops someone from doing something like take pictures. A few cops just like being jerks and like to boss people around. While this wasn’t a Secret Service agent, those are even worse. Really, really big jerks. None of the ones I’ve met have ever cared in the least about laws and rights. A regular cop making threats over non-existent laws will get reprimanded or worse when caught. There is no one who will punish a jerk Secret Service agent.
I had to work quite closely with a number of secret service agents in the recent past, and they were all very friendly. They were pretty cool, tbh. Their subject, a cabinet member, was not so friendly. The fact that the agents weren’t on presidential detail may have influenced their behavior, or it may have been that it not a public event. Either way, they seemed to be pretty low-key nice guys. Just wanted to throw that counterpoint out there.
When POTUS comes to town, local cops sometimes throw their weight around even without any particular reason for doing so. A friend of mine was asked a few years ago to get off an otherwise-mostly-empty public sidewalk while he waited for a presidential motorcade to pass by; he bit his tongue and complied, although he was annoyed. On the other hand, my wife and kids were on a public street last year when the Obama motorcade zoomed by, and they took a picture without any problem from the local cops.
Possibly the difference in the behavior of the local cops is based on how often they see things like presidential motorcades. I’d imagine that the police in Washington D.C. or Manhattan are going to be quite blase about these things, whereas in Podunk, Connecticut, they’re going to get more excited (and officious) about it.