There are probably some better examples, but I clearly remember when Charlies Angels 2: Full Throttle revealed that Dylan, Drew Berrymore's character, was entered into a witness protection program in the past, and her birth name is actually Helen Zaas. This of course allows Bernie Mac to stare straight into the camera and deliver a joke where it sounds like he's saying "Helen's Ass". Get it?
The rest of the movie was terrible and I really don't remember much, but I do know that this additional characterization didn't add much to the movie and could have been scrapped entirely. So I'm led to believe that a writer really wanted that Helen Zaas joke in the movie and had to invent a whole new identity for a character to do it.
What movies went through great lengths to make a crappy joke?