What is the science behind the inaccurate perception of colors?
First recall that pink is white minus green, more or less.
Now, your perception can be explained by adaptation: Neurons try to control their gain (amplification factor) to have roughly the same range of output. So if there's a lot of stimuli they like, they will reduce their gain, and vice versa. It can be thought of as a form of fast time-scale homeostasis in this case.

While you were in the green room, your neurons that represent 'green' gets less sensitive to green stimuli due to strong green input (adaptation). Additionally, the 'non-green' representing neurons become more sensitive, since there's less visual stimuli that they like. When you suddenly come out of that room, now the green neurons do not respond as strongly as the non-green neurons in response to white, hence your perception of pink.