People get undressed at the beach and it's implied that they don't want their photo taken while they are in a bikini. People wearing a bandana are expressing that they don't want their identity revealed.
Taking photos of people on bikinis at the beach is a dick move, taking photos of people wearing a bandana is a greater dick move. It's basic courtesy.