In Warcraft, towards the end of movie we observe the Guardian Medivh changing sides and starting to emit green light instead of blue. I might have missed that part or misunderstood but how exactly did he get poisoned?
He was actually "poisoned" even before the film history began. The correct word would be "possessed" by (maybe a spoiler for people who don't know the lore)
Sargeras, an evil titan.
Since he was possessed from the beggining, he was acting as if nothing happened, until he began to be in contact with Fel energy from the orcs and used this as an excuse. We know from the drawings in the book Khadgar finds in his library that he was one of the builders of the Dark Portal, so something weird was going on, and Khadgar found out when he infected his mana pool (blue pure energy) with Fel energy (green) and started turning into some demonic human and opening the Portal again. After the battle, when Medivh was free of the possession and ready to die, he apologized to Khadgar for not being able to control his possession and betraying the Alliance and Azeroth.