Oil might have poured into the distributor cap making bad contacts or maybe even after you changed the plugs there still might have been enough oil in the cylinders or intake to foul your new plugs.
When I rolled my truck it was upside down for quite a while. I had to pull all the spark plugs Squirted carb cleaner in the cylinders and turned the motor over without the plugs in, to clean the cylinders out. Then i replaced the plugs and changed the oil. Somehow my distributor cap got oil in it also. Just cleanned it out with some stuff for electrical that was like "brake clean"
hope that helps.
what motor/ truck do you have?