The Real Reason You Should Never Add Oil To Your Pasta Water
Old habits die hard, and perhaps that's the reason that so many people still put olive oil in their pasta water. Perhaps it's a trick they learned from their mom or grandmother, and some people believe it stops the pasta from sticking together, and prevents the water from boiling over. Although the oil may indeed help with the water boiling over (via The Kitchn), there's a better way to control this, as well as keeping the pieces of pasta from sticking — use a bigger pot!
It turns out adding oil to your pasta water is actually hurting more than it's helping. Here's why. Because oil is by nature slippery, and less dense than water, once you've cooked your pasta in water that contains oil, it creates a layer that can prevent the sauce from sticking to your pasta (via Smithsonian). When this happens, the pasta is bland, and you wind up with a plateful of unused sauce
The effects of adding oil and salt to your pasta water
Chef Fabio Viviana says that adding oil to the pot doesn't even work in preventing the pasta from sticking together (via The Daily Mail). He calls it a waste of good oil, and even refers to the tradition as "the stupidest thing [he's] ever heard about making pasta."
Viviana says that there's no problem with adding salt to the pot (unless you are planning on a very salty sauce, in which case he advises caution), and food science agrees with him. Adding salt to your pot can make the water boil faster, improve the flavor of the pasta, and you can later use the salted, starchy water to thicken your sauce, if need be (via Reader's Digest).
The one time you can safely disregard this rule and freely add oil to your pot if you're so inclined, is if you plan to use an olive oil-based sauce, which will blend easily with the existing oil from the pasta water.