Optoisolator With LED in series not working
You should not have the LED set up like this. With the 3.3V source, two 330 ohm resistors, an LED (presumably a voltage drop of around 1.8V) then that only leaves 1.5V for the LED in the opto-isolator. The typical forward voltage of that LED (according to the opto datasheet) is 1.45 (max 1.8V) so you are already pushing your voltage limits. Not to mention you have two 330 ohm resistors in series, which drops even more voltage and reduces the current to the point where it's completely useless. I'm actually surprised LED1 lights up at all.

You cannot have LED1 in series with the opto-isolator. If you want to do that you'll have to increase the voltage to ensure both diodes "switch on" (light up) and to make sure enough current can flow through them to produce enough light.

You should have done the math first, you would have seen this was a very clear problem.