Why do some guys leave the girl they think is perfect for them just to settle down with someone that's below their standards?

i.e. Guy meets a girl he adores but breaks up with her for no reason then gets with someone whom he doesn't believe is better but chooses to be the girl he settles down with.

My guy friend said it's common for guys to do this but I don't get why?

Edit: I realized that what I'm referring to is a "the one that got away" type of scenario.