If he knows it is making you feel uncomfortable, he should have this in regard and make a decision as to what's more important.
His partner or the friend.
People say you can have the best of both worlds in situations like this, but in reality, most cannot help feel what you are feeling and it is normal.
So he either helps to make you not feel like that, or feels his relationship with this friend is more valuable.
Not immature, just realistic.