The oil light is very dumb. Basically it works like this...
Positive voltage goes into one side of the light in the dash. The other side of the light goes to the one wire that plugs into the factory switch. The factory switch is as simple as can be. When pressure is above ~3 psi, the wire is isolated from the body of the switch. This leaves the light with an open circuit so it stays off. When pressure is below ~3 psi, the wire is connected to the body of the switch. If the switch is screwed into the engine block, the body is "ground", so when the pressure drops below 3 psi, the wire is connected to ground, which completes the circuit and turns the light on.
In your case, the switch was not hooked up to an oil galley, so it was always seeing 0 psi, so the wire was always connected to the body of the sensor. Where you had the sensor before, it must have been isolated from any other metal parts in the engine bay (the vast majority are connected to ground). When you moved it, it was now making contact with some piece of grounded metal, which completed the circuit and turned the oil light on. People can get similar results when they wash their engine bay...the water tends to "pool" around the switch, and can partially ground out the wire, causing the light in the dash to turn on (usually it's pretty dim though).
In your case, like ToyotaMike mentioned, just unplug the wire, wrap it in electrical tape and tuck it away somewhere, then do whatever you want with the switch itself.