@carollu Send him an email in a couple days when he's had time to cool down. Start off by apologizing again. Tell him that you're a big fan of the gym he's built. Tell him that you were excited to show the gym to a buddy who was thinking about coming over there from a competitor.
Explain that you've used your free guests before (better make sure this is actually part of the contract first...), and you and your guests have always handled this responsibility and privilege with respect. Unfortunately, this one time, you made a mistake and forgot that guests are only allowed during staffed hours.
You understand the additional liability that your mistake caused the owner and his gym as well as the disrespect caused by breaking the gym's rules. You apologize once again, and if the owner is willing to reinstate your membership, you'd be happy to come back and your friend will likely sign up, too. End.
Sure, this is kinda ass-kissy, but I'm assuming you picked this gym because you like it. If that's the case, it's worth a little ass-kissing to stay there. Plus, you did fuck up. You didn't do intentionally, but it's a fuck-up nonetheless. Take responsibility for that.
Good luck, buddy.