<flag> is for sharing a map location in chat. You get a flag on your map if you Ctrl+Right-click a spot on it (or for controller, move the crosshair to a spot and press R1), or if you click on a map link someone else puts in chat with either <flag> or <pos>. Though I'm not sure if clicking on someone else's link makes <flag> start popping up in chat the way creating your own map flag does.
I haven't spent time trying to make it stop, because I've never noticed it refusing to go away like that. I think the only time I've had it pop up automatically is when I've had the map open right after creating or clicking a map link. Try cycling your map (open/close or close/open).