Bf treats me weird

So my boyfriend about two week ago was saying I don’t fit in with his friends and that I judge them. Well they all planned a beach trip and I was nervous and I got along and had a lot of fun and put differences aside regardless of that and really got close to a couple of them (girls). Well he started arguing with me while we were there and not loving at all as soon as I started getting along with them. It just doesn’t make any sense because I thought that’s what he wanted. The first day he was all loving making sure I felt comfortable but the moment I got close he starts acting odd and treating me different/hateful and wouldn’t love on me. Has anyone been through something like this? It’s confusing?