Why does my guy friend behaves this way?

so i have this guy friend who i ended up liking (this is about 2-3 years back) we hit off pretty good especially with our conversations basically i ended up like him because of his personality. The thing that confuses me is that he has a girlfriend but he always compares himself to the guys i potentially am on talking terms with. Saying stuff like,”he won’t be better than me” “he’s not better looking than me” “oh you want me to download a dating app, i’ll only find you as a match since we live close by” stuff like these all while he still has a girlfriend. It was so difficult for my feelings, now fast forward like 2 years, stuff like this has stopped happening so i could peacefully move on until this one recent encounter, we were both drunk and i swear there was this one moment that we were so close to each other that i could literally smell his breath plus the occasional touching here and there (the innocent kind)
Everything was fine until this recent encounter, he’s my best friend (although he angrily told me not to call him that) but with these mixed signals and him being serious about his girlfriend i don’t know what to think of this.
and i don’t even know what’s worse, being an option like this or not being acknowledged as a friend?
Why does my guy friend behaves this way?
Post Opinion