I tried to remarry my ex-wife but she figured out...
I tried to remarry my ex-wife but she figured out I was only after my money.
This is a divorce joke, and also a type of joke that I am going to invent a name for right now. Let's call it a "phrase subversion" joke. There are multiple sources of humor in this joke. For one thing, the jokester is apparently willing to marry the person that they already got divorced from before. This seems like a silly thing to do, since they seem to be incompatible if they already got divorced.
The joke is also funny because being divorced, and also being caught in a lie are both unfortunate, so this joke is sort of about the misfortune of the jokester.
The phrase subversion part of this joke is the fact that ordinarily you could say that you married someone for their money, not for your money. The reason why the jokester could say that they they were marrying their ex-wife for the jokester's own money is that in a divorce one possible outcome is that one party will have to pay a lot of money to the other party, so if the ex-wife got a lot of money then the jokester was just trying to get that money back by marrying her again. The fact that they said the phrase wrong to indicate this was funny because the changing of the phrase was unexpected.