What determines how much current can flow through a 2N2222 A?
The motor needs a certain amount of current in order to turn. How much current is allowed to pass through the transistor from collector to emitter, and hence through the motor, is controlled by the current passing through the transistor from base to emitter times the transistor's current gain, known as "hfe". The base resistor reduced this current to too low a value to allow the motor to turn even when amplified by the transistor. Use what you know about the motor's required current, the voltage across the transistor from base to emitter during saturation, the voltage from MCU pin to emitter, and the transistor's hfe to calculate the correct maximum value of resistor to use. E.g.:

300mA (Imotor) / 70A/A (hfe) = 4.2mA
(5V (VMCU) - 0.7V (VBE(SAT)) )/4.2mA = 1.024 kohm

Note that the motor voltage supply is not involved in these calculations, but it still must be high enough after subtracting the voltage from collector to emitter as per motor specifications.