It’s more of an old household habit than a universal rule. In homes with properly functioning plumbing, simply ensuring the drain traps are full of water is usually the most effective way to prevent odors and reduce the chance of pests entering through the drains.
Still, many people continue using this simple method because it’s inexpensive, takes only a few seconds, and gives them one less thing to worry about while they’re enjoying their vacation. Sometimes, the simplest traditions survive because they offer a little extra reassurance—even if modern plumbing already does most of the work.