This happens to my Type 2 from day 1 as well. I haven't been able to figure it out but it doesn't seem to harm anything. I'm also wondering as well if it's some sort of sensor that's a little schizophrenic. I took it back to our local Microsoft store and they didn't have a clue. I'm not sure swapping anything out will help as I did get them to swap the keyboard and no difference. A few days later I took back my Surface Pro 2 128 and bought a 256gb version instead. Keyboard backlight behaviour didn't change.
I was hoping the latest MS firmware update would help as I believe it also updated the keyboard firmware but so far I haven't noticed any change. I haven't really been paying attention though and I suspect it may be a firmware or software fix down the road to adjust the behaviour. Cheers!