In order to understand the character of Algernon Moncrieff, one must first understand the concept of dandyism, its origins, and its role in literature.
Victorians witnessed the advent of the middle class as a powerful socioeconomic stratum in which individuals could earn their way to the riches that once were exclusive to the aristocratic classes. The growth of industrialization propelled new types of jobs, and more people were earning a good living from the benefits that came as a result of the creation of many new sources of work.
Meanwhile, those who had acquired their riches through inheritances, or family names, noticed how their own funds were decreasing since the increase in population and businesses made life in London quite expensive.
Interestingly, the upper classes would not budge and stuck strongly to their pride as well as to their supposed "rights" as aristocrats to still be placed on a social "pedestal". An example of this in the play can be seen in Lady Bracknell's ill treatment of Jack Worthing, and her interest in knowing his finances prior to learning about his family name.
Conversely the middle classes, with no family names to boast, wanted to mingle with the upper classes (many of whom were now bankrupt) to be able to earn a status. Both sides would benefit in the end. The friendship between Jack and Algernon is an example of this. Algernon clearly was bankrupt and broke, but used Jack as his resource for meals and entertainment. Jack, who had more money than Algernon but no family name, could have at least the honor of meeting Algernon's aristocratic friends.
These social dynamics compose the background from which the dandy comes. The dandy represents excess without responsibility, charm without the need for intelligence, and fun without consequences. The dandies in Victorian England (such as Disraeli, D'Orsay, and Byron among others) were notorious for possessing the qualities that would equal the metro-sexual uber fashionable man of the 21st century: Well dressed, exquisite tastes, Renaissance men-types, and charmers to the maximum.
Oscar Wilde was also a dandy, but not to the extent of the previously mentioned. He adopted his dandy persona during his second transformation (after his aesthetic years), and his purpose was to embody Balzac, who was also known for his dandyism. Wilde, as an observer of society, viewed dandies as the ultimate models of pleasure: They went around well-dressed and well-fed living only of their charms. Thus, he embodied Algernon as one of those famous Victorian characters whom seem so admirable, and yet were so naughty and irresponsible.
One cannot deny that he did the trick. Everyone loves Algernon, and the biographies of dandies are irresistible. Wilde did his best at always adding a dandy to his plays and works. They are famous for their wit, their charm, and their personal beauty. They are the force that drives most of his works and carry his most famous epigrams. Therefore, their role in Wildean literature is to charm in paper as much as their charmed in person.