I'm GUESSING it's because the microcontroller's 5V output may not be enough to switch the MOSFET, so they added the transistor to amplify the range.
When microcontroller outputs 5V, Q1 will turn on, and G will be close to ground (because of the R2/R3 voltage divider). When it outputs ground, Q1 will turn off, then R2 will pull G up to 12V.
Note that the voltages are inverted, but now we have 0V to 12V.