So I was talking to my boss in the hallway today. During part of the conversation I turned to face somewhere to the left side of him for ~ 20 seconds, I think I got restless/bored from standing still. He curtly/angrily demanded that I face him when talking. I was quite offended. To me I thought that it was almost like a parent chiding their kid. Was I overreacting and does he have a good point or was he being out of line?
It is highly desirable to face the person you are talking to. Facing away transmits the message that the person you talk to is not important to you.
I was quite offended.
You should not be. As long as your boss just made a statement, there is nothing offensive in this.
To me I thought that it was almost like a parent chiding their kid.
From the point of view of your boss, he was only providing you feedback and some guidance. He proceeded very good.
We had a university colleague who would face away when shaking hands with somebody - pretty much as a rule. For a while we ignored him, but in time we would loudly "give feedback" to him (in a friendly / joking way): "John, please look at the person when you shake hands!!"
I cannot tell for sure if things improved (university ended, we split ways), but facing the person you interact with is highly appreciated (while the opposite is quite frowned upon).
During part of the conversation I turned to face somewhere to the left side of him.
If you turn your face occasionally during speaking, should be OK, as long as it is only for a few seconds. It is human nature to not maintain statue-like position.
Since you turned long term away from him, that was not OK, and he was more on the side of being right, compared to you.