Why do husbands cheat

I guess I’m just looking for closure. But does anyone have any ideas on why a husband would cheat on their pregnant wife? I’m still in shock and can’t believe it. I just don’t understand. I’ve been up all night with a million thoughts trying to figure out what I did wrong.