It seems mostly like a boomer thing to do, honestly; I don't really hear "I hate my wife/husband" jokes from folks my generation (Millennials) or younger. Honestly, I mostly hear "I hate myself" jokes there.
A lot of the "ol' ball and chain" etc jokes tend to be more frequently casting the wife as the enemy instead of the husband, too, so there's some definite boomer misogyny as key element.