Why did Jane Austen create the character of Mr.Wickham in Pride and Prejudice?
Wickham serves to teach Elizabeth a lesson about her perceptions of people and the reality of their true character. Elizabeth is quick to judge Darcy for his rude comments at the first dance, and can't get past those assumptions for a significant portion of the novel. Wickham, on the other hand, is charming and thoughtful towards her, so she assumes that he is a good man and is telling the truth about his version of the story that Darcy was cold-hearted in his past dealings with Wickham and that Darcy is "the bad guy." When the truth comes out later, Elizabeth is ashamed of her behavior and realizes that she was wrong to judge Darcy without evidence and was foolish in trusting a man like Wickham just because he was charming and seemed to confirm what she already believed about Darcy. She learns that her judgements and prejudices held her back in finding her true love for Darcy.
Jane Austen, through her letters, had shown her apathy towards the societal need to hasten a marriage for the sake of appearances, financial stability, and communal acceptance. The marriage of Wickham and Elizabeth's sister, Lydia, exemplified one of such marriages. Austen basically sent a message to society saying how bad those marriages end up, and how lonely the wives will turn out to be. In fact, Lydia was always alone from what we gather, because her husband would always go "amuse himself" in the big cities while she ended up visiting her sisters. Hence, the message (although is obvious to us in the 21st century) was quite strong for Regency England and was particularly shocking for women to hear back then.