Getting caught got him the grief, not the lying. He might have told her right off the bat and still copped the same outcome.
Females can be extremely contrary and logic doesn't always apply.
It depends on the girl and whether you know that her reaction will be negative regardless of either telling or not.
But then again, that's why I choose to remain single until such time as I find an easy going relaxed and confident partner. Could be in for a bit of a wait though.