Sneaking out, by its very sneakiness, gives the impression you are doing something wrong. You could leave your house and go straight to confession, but when you sneak there, the perception is that you're up to no good. That's the first hurdle.
The second is that your girlfriend is now living under the assumption that you don't trust HER. I totally get that you and your friend needed some time to talk about things - and everyone should have the right to talk privately with their friends - but to her, she very likely sees this in a very black and white way: "He didn't trust me to be in his conversation AND he didn't trust me to be able to handle him wanting to be alone with his friend, SO HE SNUCK OUT!" You can see where feeling like this would cause her to become very defensive and start to question many other things, fairly or not.
I don't think, just knowing this information, that this is an unsurmountable situation, but the thing you most need to do is make sure she knows that you understand why she feels the way she does. No apology can come across as sincere if the apolgizer behaves as though the whole thing is ridiculous. Explain to her that it wasn't your intent to ditch her and that your friend just really needed to talk to you about something he was too embarrassed to address in front of anyone else. Let her know that you now realize that sneaking out wasn't a good choice because it showed a lack of trust in her and tell her you now definitely see how all of your actions can affect her. Promise to be more considerate in the future. This really is all you can do and the rest is up to her.
Good luck!