The real why is possibly among the last things you and your WS will realize after the healing process.
And there is a better time for finding that answer, a worse one too (when the DD just comes out, the why will be torturing you but it's hard to get, you will get an interpretation).
I will try not to get too deep into it and keep it brief:
We are humans and we follow behavioral patterns, we are wired to seek security into other humans, a relationship is the closest and smallest "tribal group" 2 people can form, hence is the most 'sacred'.
It is where the rest of the entire human social structure stems from, it's not just a shared cooperation, but shared vulnerability as well, that's why the core pillar of it is trust, which should be unconditional.
That's why a betrayal shatters your entire reality, it hits you at the core of your primal survival wiring. Is biological.
Another point to consider: we are (in general) neither monogamous or polygamous, those are states we fluctuate to according to our moment in life. Polygamy has it's uses (genetic survival, enlarging your 'tribe') because it helps you to 'vet' which person and to what degree can benefit from your trust. When you find one who inspire you the feeling of "absolute trust" you are naturally drawn to monogamy (there is chemistry in action too, but we ignore that here, that's temporary and by design to increase the genetic survival, we talk about long term / post dopamine drugged relationships now).
Consider this: when you have a friend, you trust them, you like this person like a member of your family sometimes, you give them a lot of trust, they often know your secrets and you know theirs, and you both have your back. However it is unusual that no matter the friendship, you both share unconditional trust. It is a lot but almost never to the extent of what you share into a relationship.
We are talking of sincere friendship here (not superficial or fake), and if you consider the situations where there is a betrayal of friendship are less common that betrayal in couples.
Here is the first "why"?
How comes that friends are less prone to betrayal, while 2 people who are so intimately close like a couple are more vulnerable to it?
This gives you a clue why so many WS never ever imagined they could betray their BS, and why so many times we BS get blidsided. And why it hurts so deeply.
Since you plan to retrain your brain I stop here for the moment and let you pick up. I must warn you it will become a painful exercise and the why you may find might be harder to digest than staying without answers.