If its the bit im thinking of, I remember thinking how random it was when he did that. Didnt even seem like a violent character until then
It was clearly a well-planned character. They designed him as a classic sociopath - they aren't violent, they just have no empathy so human life doesn't factor into their decisions.
Some signs of a sociopath:
1. Charming and likable
2. Stay eerily calm in stressful circumstances.
3. Manipulative and very comfortable lying.
4. Has zero qualms about instigating violence.
5. Complete lack of shame regarding evil acts they do
They definitely made him as likeable a sociopath as possible to freak the audience out that much more when his casual, shameless violence was revealed. And to show how close to that spectrum Walter had become, when WW basically chose the sociopath over Jesse.