Why to use opto-transistors when controlling a DC motor from a microcontroller?
Those that don't understand the science resort to religion.  The rule of always opto-isolate a motor driver is a religious belief that seems to have a small cult following, but that doesn't make it good engineering.

If the motor power supply and the micro power supply both have the same ground, then there is little reason for isolating the control signal.  I have designed a number of real industrial devices where motors were controlled by microcontrollers with the same ground reference, and I haven't otpo-isolated the control signal once.  There can be reasons to do this, but they are unusual.  There is no substitute for understanding what is going on.  Religion has no place in engineering.

However, you do have to use the right circuit.  Your's is a mess, considering there are only 4 components and most of them are wrong or don't make sense.  First, the transistor should be a NPN, not a PNP, if it's going to be a low side switch.  Second, the resistor and inductor make no sense at all.  The resistor will only waste power, and the inductor will cause even higher kickback voltages than the motor by itself.  Third, you left off the all-important kickback catch diode.  Without it, the switch will be fried when the motor is turned off.  Fourth, you need to limit the current into the base.

Here is a circuit that would actually work:



In this case I used a N channel MOSFET instead of a NPN transistor as the low side switch.  The advantage is this FET can be driven directly from a 5 V digital output and can support higher motor current without the current gain of the transistor getting in the way.  This particular FET can support up to a few Amps and a power voltage up to 20 V.  Since it appears you are using a 12 V supply for the motor, this will be fine.

Note D1.  The motor is partially inductive.  When trying to switch off the current in a inductor, the inductor will make whatever voltage it needs to sustain that current in the short term.  Without the diode, it would make enough voltage for the FET to conduct despite being off, which would damage it.  The diode provides a safe path for that current that requires no high voltage to be produced.