From a legal perspective it is all about fair and equitable. Meaning that both parties get about the same amount, and this it is fair to both parties that are not getting screwed out of the divorce. The mother is not getting "screwed", she is getting the majority of the joint assets (the pre-nup covers the condo so it is not in the marriage assets). The judge could have forced her to sell the house, and split the assets, yes. This is why Frank was such a stand up guy and said he is not contesting the house, and giving it to the ex. So she has a place to live, and Lilly/Becca have a place to call home. He had his already protected condo. The cars and money, he contested and it was split down the middle.
As for if the pre-nup holding it depends on how [well] it is written. Most that I have seen have clauses for infidelity, length of marriage, death/beneficiaries, etc. Since she cheated that clause would have kicked in and she would have gotten nothing. However there is typically a morals clause in a pre-nup (since again - it has to be fair to both parties, which is where many get thrown out), which states that if Frank did something to destroy the marriage, the pre-nup is null and void. This is what she was trying to invoke by her wild accusations at the end of the meeting. At that point, the judge, could have basically said a couple of things. One, she had a house, he had a condo (since everything else was split down the middle, assuming the same value). She was probably hoping to weigh on sympathy from the judge and get more. She got a judge that saw through her shit. A different judge might have been more sympathetic, and done something completely different.