MOSFET Always On despite of Pull-Down
If you are sure about your hook-up, you are simply using the MOSFET the wrong way. In this I assume you have the negative of the 12V connected to the same ground that your sometimes present 3.3V has its negative.

The N-MOSFET looks, on the inside, more like this:







simulate this circuit &ndash; Schematic created using CircuitLab

So your set-up turns on the LED through the diode inside the MOSFET, because you connected the positive terminal entirely on the wrong side. It's called diode-conduction and that needs no gate voltage at all.

For your first experiments with MOSFETs, using them as switches, you need to make sure the Source of an N-MOSFET is always at the 0V potential, for a P-MOST (not yours!) the source should always be at the supply voltage.

So your schematic should look like this:







simulate this circuit

Later you can progress to circuits that use MOSFETs that do not connect their sources to the correct voltage points, once you start understanding what's going on. For now, stick to the rule above.