As I understand you, you are being publicly shamed (in front of fellow grad students) by this professor by dint of your undergrad record.
If you are in the US, this is violating FERPA by revealing your academic record. Other countries have similar privacy laws. File a FERPA complaint and wipe that smug smile off his face.
I'm no expert and I suspect each school is different. But this is a federal law and I think most schools would take such a blatant violation seriously. I'm pretty sure this prof would get his leash yanked pretty hard.
Note that it could backfire. You could an enemy who will make your graduate experience miserable. But I'm betting against it. There have been a number of times when I just let a jerk be a jerk because I thought my life would go more smoothly, but found out later that if I had stood up for myself, I would have gotten a standing ovation from 99% of the people around me. This prof is a jerk and his colleagues will likely appreciate him being called out.
Also, in the case of harassment and rights violations, the perpetrator is warned against retaliation in any form. And someone will be watching for it. Someone behind those closed doors will tattle. I think you are perfectly safe.
When I taught small classes, I would write all the test scores on the board, so that students could see where they ranked. One young lady thought I was violating FERPA with this tattled on me. I got hauled into the chairs office where he was accompanied with one of those university JD types (the law students who never pass the bar, but get jobs at universities being annoying.) and the dean. They were ready to have a field day with me. They had already talked to other students and had corroboration that I had, in fact, written all the scores on the board. The JD was salivating.
We talked at cross purposes for a while, then they figured out that I was writing numbers only. No names. No personal information was being displayed. They were so disappointed. An administrator gets to be administrative so rarely and here they had an open-and-shut case go up in smoke.
So the point here is that at this school at this time, FERPA violations were a big deal. I suspect that in the current safe-room environment, they might be a bigger deal. Telling the class that that guy right there has a low GPA could traumatize him for life, eh?