Transistor use - Basic fan speed controller
You need a PNP transistor for the high side switch. Your circuit only "works" because current flows across the BE diode - it is forward based after all. 

Remember that for an NPN transistor, the base must have a potential of ~0.7V above the emitter, which is only possible in your circuit when CE resistance is high enough.