The text is a play on the concept of marital status, contrasting the temporary nature of a 'wife' role with the permanence implied by 'ex-wife.' It does not rely on the different meanings of a single word or similar-sounding words for a humorous effect.
A wife lasts as long as a marriage , an ex - wife for ever .