The text is a play on the well-known saying 'An apple a day keeps the doctor away,' but it replaces 'apple' with 'girl' to create a humorous twist implying infidelity would keep one's wife at bay. It relies on the structure and familiarity of the original phrase to create humor, not on different meanings of a word or similar-sounding words.
A girl a day keeps the wife away .