I was wondering what the purple poison looking thing that randomly appears next to some of the monsters is during battle?

It’s means just that, they are poisoned, and they will slowly loose health.

Ah ok. Thank you. Why do they randomly get poisoned?

Where “slowly” means each time TU is used up. 

They get poisoned from plague, venom shot, various other abilities. Some monsters poison you when you kill them.