Xue Pan is a frequently appearing yet not terribly important character in the Dream of the Red Chamber. His younger sister, Xue Bao-chai is a central character.
The major function that Xue Pan plays in the book is to demonstrate how disgusting and uncaring men are, in line with the books notion that men are like mud, women are like water. OF course, there are many other characters to prove this point, but Cao Xueqin apparently wants to drive his point home well.
Xue Pan is rude and disgusting, given to gambling, drinking and brawling, as well as carrying on affairs with both men and women. Despite his sometimes violent personality (in one instance, he kills a waiter for bringing wine too slowly) Xue Pan is also a wimp, afraid of offending his mother, his sister and his wife. He also gets horse whipped and thrown in a ditch by a female impersonator who is offended at being taken for a homosexual.
Xue Pan also is good that despite the fact that both he and the hero, Jia Bao-yu are both passionate, perhaps effeminate, unconventional men who don't want to live the lives of a dignified scholar, Bao-yu actually appreciates beauty for what it is, while Xue Pan merely likes it to feed his appetites.