I have wondered a great deal since I betrayed the trust in our M and saw how harshly he has reacted, how honest he has always been with me. I know it's weird that the person who betrays always ends of thinking the other person is betraying them.
But he betrays the trust by lying, and by going against agreements:
"So I asked why he lied then. He said because he knew he shouldn't have gone anywhere since we sort of have an "agreement" not to go out without the other person."
BTW, that "agreement", originating from your H, was about him tagging along when you go out so as to curtail any suspicious activity on your part, I'd imagine, right? That's like a band aid when it comes to repairing a relationship, isn't it?