Why do guys act weird

Anna

So my ex and I are friends he recently got a new girlfriend which I don't really care about but he found out I was mad at him cause he kept telling me pointless little white lies and I would find out anyways he absolutely hates when I'm mad at him and I was really surprised how he reacted it was like he slightly cared and we talked it out and everything and just chilled and had like a half hr conversation we hadn't talked in like two weeks, at the end I usually go in for a hug but I wasn't this time and he cautiously asked if I wanted one like he was caught off guard I didn't go in for one but he's in a relationship now and I didn't really care. But why do guys act so weird it's not the first time with another gf in the past he would walk straight up to me when we would see each other in public, she was behind him and wouldn't move, I was so passive aggressive towards him and not myself ( cause he ended up dating his neighbour ) which bugged the crap outta him. Anyone have this happen to them or know why?