There is a difference between trying to figure out what you told yourself, and felt, that led you to take the actions you did, and justifying it. But, not understanding those things does leave you in a vulnerable position.
My H read a book called Sexual Detours which helped him get on the path to figuring out what went wrong. There are other books as well. I, as a BS, felt his willingness to look into it was profoundly helpful to me, and has really helped me trust him more. It was painful for him, but he took a long, hard look at what he was thinking and telling himself. I don't know if that = a "why," but it is close. (And here's a hint - it usually has very little if anything to do with the BS.)