Why did my Co-Worker try to shame me?

We work at a grocery store and a customer stopped me to asked about a deal and he’s unsure if the other pizza were on sale. My co worker was in the aisle helping another customer and I was unaware that he would pay me any mind.

The customer and I is socializing and talking about the deals and finally he understood it wasn’t on sale and he says: “Wow, thank you so much.”
My Co-worker says in a monotone voice: “You’re not supposed to be doing that and helping you’re just a cart person.” I asked him why didn’t he help and he mentioned that he was helping another customer. I replied, “Welp”.

. We’re at the same job !

Thoughts?
Why did my Co-Worker try to shame me?
Post Opinion