Understanding This Arduino Circuit
It looks like the motor is receiving two positive sources of voltage:
  one coming from pin 9 after it goes through the transistor-- then
  another coming out of the 9v battery, down the power rail, and into
  the motor.



Pin 9 provides a signal, not power. And the signal is applied to a NMOS transistor gate. (Or, at least, I think so if the circuit works okay. I can't be sure, because your picture doesn't specify the exact device involved and they can be packaged differently.)

I think this signal is a gate voltage. It doesn't directly connect to the motor. Instead, it signals NMOS transistor to connect the other two pins it possesses together.



  Why is the power from the 9v battery necessary?



You'd mistakenly believed that Pin 9 provides a voltage to the motor. But it doesn't. So the motor needs access to a low impedance voltage source, which in this case is your \$9\:\textrm{V}\$ battery. Note that I said "low impedance." The \$5\:\textrm{V}\$ power supply for your Arduino is also low impedance and it could have been used, too. (Depending on the motor and whether or not it really needs the full \$9\:\textrm{V}\$ to operate well.) But you could not have used Pin 9, which is not a very good voltage source and couldn't run the motor on its own. Pin 9 can signal with voltages. And with very low power devices, like LEDs, it can power them, too. But it cannot drive motors. It just doesn't have the capacity to handle that. So, instead, Pin 9 is used to signal an NMOS device to do the work.



  I thought the transistor's purpose was to modify the electrical
  current so that it was capable of operating the motor.



This transistor is operating like a switch. And just in case you were imagining differently, a transistor cannot create current out of thin air. A power supply provides the current compliance.



  Further, if the 9v battery is connected to the motor, why is that in
  itself not spinning the motor?



It is.



  I don't understand how everything's flowing back to the leftmost
  ground rail. From the perspective of the motor, one wire is attached
  to the positive lead of the 9v battery and the other wire is attached
  to the gate coming out of the transistor. How is this thing grounded?



The \$9\:\textrm{V}\$ battery doesn't need to go through the leftmost ground rail. There is a bottom horizontal wire in the image which connects the (-) of the \$9\:\textrm{V}\$ battery to the (-) of the Arduino power supply. But that is there to set up a galvanic reference against which the NMOS gate is then driven. This allows the otherwise single-ended Arduino output on Pin 9 to do its job.



  The positioning of the diode throws me off even further. My
  understanding was that their purpose in a circuit like that was to
  prevent electricity from flowing back into the circuit from components
  like motors, but in this circuit, it doesn't seem to be positioned
  between the motor and the rest of the circuit like I'd expect.



It is arranged parallel across the motor, opposite to the polarity of the \$9\:\textrm{V}\$ battery (otherwise, it would conduct when the battery voltage was applied.) It's there to allow accumulated energy (evidenced as current) in the motor, when turned off, to have a galvanic path to move through and to allow the magnetic field to discharge its energy in a managed way.

I think the circuit looks like this:







simulate this circuit &ndash; Schematic created using CircuitLab

Software must be monitoring the switch and then driving the NMOS switch to operate the motor. Perhaps you can slightly better see that a shared ground would be required in order to operate the NMOS switch's gate.