I find myself doing this too. I think that, at least for me, it comes from a mixture of fear, romance repulsion, and internalized arophobia/amatonormativity. I have been convinced by society that I am inherently less important than my friends' romantic partners, and so I subconsciously remove myself from situations that reinforce that idea in order to make what I feel is an inevitable outcome less awkward and less painful.