I don't understand why do I need to put a resistor between the gate and the source of a N-type transistor in this circuit
When your microcontroller comes up, it's GPIO is in high-Z state, maybe pulled up(that means there is an internal resistor to VCC which may be enough to turn on the LED) . Its a good practice to pull down anything you don't want to work uncontrolled. So when the firmware initializes the outputs, you don't need the pull down resistors anymore. Only on power up/down or JTAG programming.