Ex boyfriend drama (?)

Mary
My boyfriend and I of three years broke up about one month ago. In the last month I started talking to a guy I knew (nothing ever happened- no physical cheating) and we both became emotionally attached! At the time my boyfriend and I hadn't had sex in over two months and my friend knew this, thinking we were going to continue not doing anything. We ended up having sex a week before we broke up, but I never told my friend. I just told him today as things are progressing with my relationship with him and he's genuinely upset towards me. He thinks I should have told him and says he wouldn't have gone and hooked up with someone a month ago, but I did. Is he in the right? My ex and I were still dating! I feel terribly, but I also don't quite understand my friends anger at it. Any advice on how to ease his anger?