A pithy and colorful way of saying 'don't do things that are likely to have bad consequences near where you are required to do things that might be required to support your life.'
A good example might be sleeping with a coworker. Another would be having an affair with someone who you and your partner see frequently in social settings.
Closely related to Bad Idea jeans.