Strange behavior from n-channel MOSFET
Assuming that the circuit is as shown and that you have the MOSFET pinout correct, then your MOSFET appears dead - and also acting unexpectedly.

3 V is not really enough to operate a BS170 - 5V is better. If changing to 5V (reccomended) re calculate LED resistor below. 

The circuit is valid as shown BUT is rather more complex in functionality than you'd expect. I'd suggest putting the 220 ohm resistor in the Drain circuit in series with the LED for now.

Presumably LED is Red. If so Von ~~~= 2V so 1V left for 220 ohms so current ~~= 1/220 ~= 5 mA. So resistor could be as low as say 56 ohms for most LEDs. 
R _LED ~= (Vcc-VLED)/I_LED.
 eg for 2V LED and 20 mA.
 R = (3-2)/0.02 = 50 ohms. so 56 ohms std E12 value is fine for ~= 20 mA.  

LED with higher Vf will be vv marginal here.
 White LED will glimmer. 
 5V MUCH better.

Having a floating gate on a MOSFET is not a good idea.
 Any MOSFET tends to be ESD  sensitive - especially the gate. Touching the gate when it is open circuit and you are not grounded can ruin the MOSFET's day - and all days after that.

The circuit behaviour is extremely strange. It suggests that you have the FET pinout wrong. I'd suggest that you carefully check the pinout. It it's right repeat the check and keep repeating until you find it is wrong and then fix it :-) ie the behaviour is very very strange to the point of being almost inexplicable.

BS170 datasheet here

The graph below shoes that with Vgs = 3V (3V on gate) int will condi=uct / carry / swithc under 100 mA typically. How much under 100 mA is uncertain and varies by device but ~= 0  mA is possible.
 4V is better and 5V is much better.



Be ABSOLUTELY CERTAIN that you have the pinout correct