Uncle Tom is a racist term that was used by the KKK to describe black people who wanted to "act white" by selling out other black people.
But it's wildly inaccurate. It has nothing to do with the actual book Uncle Toms Cabin, one of the most popular books ever written (it outsold the Bible in the 1850's). Harriet Beecher Stowe who wrote the book was an abolitionist, she was very very anti-slavery like Mark Twain. Uncle Tom in the book is based on an actual former slave, and Uncle Tom in the book, if you actually read the book, SPOILER ALERT, is beaten to death at the end for refusing to give up the whereabouts of 2 other slaves. That's Uncle Tom, a martyr.
Calling someone an Uncle Tom means you're calling them a hero, not a sellout. The whole phrase you're referring to comes from the play that was written afterwards which turned Uncle Tom into a meek character because the play writers didn't think people would've liked the ending of having a man beaten to death.
Here's a wonderful article about it
https://www.npr.org/templates/story/story.php?storyId=93059468
Quoting from the article:
MARTIN: What is it that African-Americans hate about this story?
Prof. TURNER: Many African-Americans don't hate the real story that Stowe wrote. The Uncle Tom character that she gives us is extraordinarily Christian. The climax of the story really comes when Uncle Tom is asked to reveal where two slave women are hiding, who had been sexually abused by their master. And he refuses. Knowing that he is going to be beaten to death, he refused to say where they are. And African-Americans who have read the novel can appreciate what kind of heroism that took for a black man to sign away his life to save two black women.
Unfortunately, the stage depictions don't include that part of the story. They grossly distort Uncle Tom into an older man than he is in the novel, a man whose English is poor, a man who will do quite the opposite, who will sell out any black man if it will curry the favor of a white employer, a white master, a white mistress. It's that distorted character that is so objectionable to African-Americans.
Prof. TURNER: The producers of the early stage shows didn't think that they could attract an audience for the Uncle Tom as he was depicted by Stowe. They couldn't sell tickets to a theatrical production, the climax which would have been this man dying, rather than the revealing the whereabouts of these women.
They could sell tickets, as they had been successful by showing blacks in minstrel depictions, showing them liking to dance more than they liked to work, showing their insensitivity to each other, showing their willingness to tell the master or mistress what he or she wanted to hear. That sold tickets, and so those were the shows that they produced, staged and circulated throughout the world.
I highly recommend everyone actually read Uncle Toms Cabin