Guy Friend confusing me help?

Guy I am mates with through work, I am finding confusing.

We talk loads on message at work, he tells me lots bout his private life, and tells me his problems etc. He does not open up to a lot of people.

He can be bit flirty but a nice person, he does have a girlfriend. We go gym togeather and spa, just to chat one on one he likes our time, teases me loads, but once in the gym he randomly kinda tried on, took clothes off, I was in shock, he then the next day said moment of weakness but said unsure why did. Then went on night out and he barely spoke to me which did upset me, so I asked him on night why, we mates as upset me, then saying some weird nasty stuff and said I am annoying leave him alone. So I ignored him at work, and he sent me 30 msgs in one day begging me to talk to him again, he was so sorry never meant it, really upset him, I am so confused we have been good friends, and now gone bit weird, as in i am unsure why he deseperate to go spa even, but denies liking me. I need advice on what people think? He has girlfriend and respect that, I just want my friend back, he even said I am his cuddling me.

Guy Friend confusing me help?
Post Opinion