I think many people leave the flag in because it gives them a false sense of confidence. Many people think they can hit their putts harder, because the flag will “save” them from going past the hole.
Whether the flag is in or out if you don’t hit the putt on line you will miss. If you hit it harder because you think the flag will save you, you will probably pull the putt.
For longer distances I think leaving the flag in can help with depth perception, but for putts I think I will make I want it out, to me it is more of a distraction.