The police obviously acted out of line here, but it's pretty difficult to come up with a general principle of how to deal with public recordings.
Of police and other officers of the state? Totally should be allowed. What if they're interacting with some member of the public, though? That person may well desire not to have their face associated with a confrontation with the police, for professional reasons and otherwise. On the other hand, a bystander recording a confrontation can provide the key piece of evidence that lets someone being victimized by the police get justice.