The quarter horses we ride sometimes pin their ears back if we are riding abreast and they are not too comfortable in that position. Sometimes a little jiggle on the reins or a word will make them stop. However, if they still don't like being so close, we just move a foot or two ahead or behind and that makes them happy. The whole group is generally good natured and well behaved, so if we see signs of unhappiness, we try and make it better for the horse. Observe and try and connect what is making him upset.
Another time that they sometimes do it is when tied on the cross ties and the horse in front steps too far back into their space. I just ask the horse to move and the ears go back up and everyone is happy.
The only time I won't tolerate the pinning of the ears is when they go at me. Example, one horse doesn't like a certain curry brush. If you try to use it on his back, he pins his ears. I give him a light slap on the neck and tell him no! He will usually stop and I usually use another brush, but I will not let him get aggressive with me.
Happy trails.