I'm upset that my bf invited a friend to stay for the weekend without talking to me first
Is there any other reason you are upset about his invitation?
I don't want him to have any friends
Being courteous in a relationship goes both ways. He was wrong to not ask you if you minded him having someone over, but you are in the wrong to not want him to have any friends. The two of you should talk out your feelings, as your relationship will benefit from it.
I don't want anyone to ruin our sex life and he has to understand that.
I know that you want to spend intimate time with your bf, but rudely wanting to cut him off from other people makes things worse. Set aside some time later to be with him and for now be happy for the company.