I would hardly call kicking someone for going afk "betrayal". When you go afk unannounced while playing with other people, of course you are going to get kicked. People have lives and can't sit round wondering when/if you'll be back. Your friend was in the wrong was going to be punished for doing so(Not even a major punishment or anything, just being kicked out of the party), but instead you tried to defend his wrongdoing and got punished as well. That's what happened.

Overall though, it's just a game. So none of this is really a big deal or anything. Just go again tomorrow, and this time tell your friend not to go afk.