Grounding an Opto-isolated Microcontroller
Your circuit diagram does not show how your PWM generator (Raspberry Pi in your case) is powered. I will guess here that it is a separate power supply based on an isolated transformer, like a wall wart (ubiquitous little black plugin boxes that waste energy 24/7 when people leave them plugged in). You also do not show the thermocouple connection, which would be helpful. Interfacing a thermocouple to such is apparently non-trivial:

http://www.element14.com/community/community/raspberry-pi/raspberrypi_projects/blog/2014/11/14/temperature-measurement-for-lab-and-science-projects

So my best guess/speculation (until further details are provided) is that the thermocouple is picking up noise from the motor and messing with the Raspberry Pi.

The first solution I would try would be to electrically isolate the temperature measurement function from the Raspberry Pi, or use a measurement method that does not involve dangling long wires. I have temperature measurement ICs in my junk box, maybe you do, too.