I don't think there's anything wrong with hoisting a, for example, Circassian flag if you're doing it on your own property (especially since for Circassians it's more of a cultural throwback to their old heritage as many of them are well-integrated Turkish citizens). Like, for example, a Greek who lives in Istanbul and wants to honor both his new home and his old home hangs the Turkish and Greek flags side by side outside his home. Or maybe some British expats hang the British flag outside their summer home by the beach. I mean, immigrants do it in other countries. I don't think it's as big of an issue.
However, these dudes just blatantly went up to a public beach, took down one flag and hoisted an Afghan one. This is disrespectful. In a functioning country, they would've been taken in for questioning. In a North-Korean-style dictatorship, they would've been shot on the spot. I have heard of very few instances anywhere where such behavior is at all tolerated.
EDIT: Oh and about the death of the young man, this will end badly. People in Turkey have a much shorter fuse than, for example, people in Sweden, so Afghans will definitely start being killed now. Some might even take the opportunity to stab a Syrian or an Arab migrant.
Watch yourselves over there.