Okay now factor in the probability of divorce, and the amount you get to keep afterwards, and discount it to present value, vs. paying more taxes and keeping it all. Also remember that you typically lose half of income forever, not just wealth in a divorce.
Not sure why this is being downvoted. It should be a very real consideration at least in the US.
It is important to understand the consequences of breaking any contract you enter into, including marriage. Luckily, you're not stuck with default terms to that contract, and if you're not comfortable with them pre-nuptual agreements can modify those terms.