Why does my dc motor immediately spin when connected to a 9v battery?
Your wiring diagram is a jumbled mess, and makes it impossible to figure out what's really going on.

My guess is that you have a mistake somewhere in your wiring. 

Problems I see with your wiring diagram:


You show pin 9 from the Arduino wired to the positive rail of your breadboard. If the positive rail is connected to a 9V battery, this will likely destroy pin 9 of your Arduino.
You show the gate/base of your transistor wired to the positive rail of your breadboard. This would switch your transistor on constantly.
You show the symbol for a MOSFET transistor, but the label on it lists it as a 222A, which is an NPN BJT, not a MOSFET.
You don't show any wires connecting the left and right side rails of your breadboard.
You're using a row of your breadboard as the ground rather than the rails. 


The picture you posted is too small to tell if your wiring diagram is wrong or if you actually connected things incorrectly, and the wire from your 9V battery is blocking the camera's view of key connections.

It looks like your wire from pin 9 is NOT connected to the power rail, but is instead connected to column 1 in your breadboard, which is good. 

There are some strong conventions in wiring with breadboards and you should learn to follow them. The two pairs of columns of sockets on the left and right are for positive and negative supply voltage. Usually you wire them together and connect them to regulated power. Sometimes they will be used for different voltages, although you need to be really careful if you do this, since connecting to the wrong side can fry components.

It's confusing the way you've created your wiring diagram, but it looks like you have your flyback protection diode wired correctly, which is good. That's very important, as DC motors and other inductors create destructive reverse voltages as they are switched on and off, and without a flyback diode it can destroy solid state devices like ICs or even transistors.

You should re-wire your breadboard using the proper conventions, and post a corrected wiring diagram that really shows what's going on. 

A picture where we can see all the wires and components clearly would also help.

Until you better learn what you are doing I would strongly advise against powering things directly from a 9V battery. When you do that, a mistake in wiring will fry your Arduino and/or any ICs you have on your breadboard. 

Wire the 9V to the V-in pin on your Arduino, and then bring 5V and ground from the Arduino onto the +/- supply rails of the breadboard. 

I also notice that in your code, you never set the state of controlPin in your setup method. You should add this line to your setup:

digitalWrite(controlPin, LOW);


That way the pin starts out in the OFF state, and then later on you can us an analogWrite to set it to the desired output level.