Voltage drop after optocoupler
The optocoupler is able to switch a few mA (the datasheet says max. 30mA @ 5mA input current) which is enough for a LED but obviously by far not enough for your DC motor.

A simple solution would be to add a transistor at the secondary side (motor side) of the  the optocoupler.