The judge had a choice, to sign that ridiculous grossly one-sided agreement or not. Period.As was said, no scam here. The OP was just fine with this. He considered it a fair price to pay to be done with things. The OP is the one who did this to himself. Period.
I'm willing to bet if the roles were reversed, the judge would have never signed if the wife agreed to pay permanent alimony after a 5 year marriage. Period.