What should you do if someone you thought was a good friend told a girl he knows you hate that he is not really your friend and when you asked him about it he said he was just joking?

You need to find better ways to gauge friends. Let me get this straight. You thought the two of you were really good friends but you knew he meant it when he said it. What exactly made you think you were friends? I dont know if your a guy or a girl by your question but if your a girl maybe he's saying it to get you jealous and if your a guy maybe he's saying it to get in the girls pants. Either way friends like that are no friends at all. I would sever all ties with this person and ignore them like they never existed and in the future dont assume anything. Friendships are developed over time with honesty, trust and caring. Doesnt sound like you had any of those... Good luck...