Why would you want this person as a friend after the way he behaved? He told lies about you, and tried to cheat on his girlfriend with you. He doesn't sound like a very nice person, and he's just revealed his true colours. It's sad that you were good friends for 5 years before this happened but if he cared about the friendship at all he wouldn't have done the things you mentioned in your post. Look how quick he was to turn on you when he thought you'd revealed his dirty little secret.
Btw, you owe it to his girlfriend to tell her the truth about him. Particularly as rather than giving you a slap like many would, she asked you if it was true. Think how you'd feel if the roles were reversed.