In order to properly address the question, one must understand Wilde's world.
It was the 19th century Victorian London and the Queen had made a point to instill in society a very exaggerated sense of family and morality to counterarrest the debauchery that existed in the English court centuries before her coronation. She gave her name to an era: The Victorian era. With it came pictures of the Queen with her family, her showing a sort of cheesy admiration for her husband, Prince Albert, and a lot of other stuffy and over-accentuated details that put England back behind the Bible, and under a myriad of physical and psychological limitations, all in the name of morality.
Wilde hated that. Indeed, he produced entire works dedicated to his disagreement with this new way of thinking, which directly put artists, actors, poets, performers, and even painters under a "neighborhood watch" where they could not even express themselves without some complaint. Wilde would comment on this phenomenon in An Ideal Husband, The Picture of Dorian Gray,The Decay of Lying, A Woman of No Importance, and (sadly) he also applied this hatred of conventionalism and superficiality to his personal life.
The Importance of Being Earnestis the equivalent of a modern day satire of a weak reality show. In it, Wilde sent a powerful blow to society in the person of Jack Worthing, who is a fatherly figure, warden, and head of a country estate. Yet, this same Jack detests the conventional life in the country and comes to London under the persona of Earnest to meet with his equally double-life cronie Algernon, so that he can run high bills at restaurants, cause havoc, and be the rebel he is at heart.
The poignant point here is that, of all names he could have chosen to come to London to be a bad boy, he chose "Ernest." Semantically, this is an irony as "earnestness" is a quality of dignity and morality. Even more ironically, it causes a mysterious effect on the main female characters, Cecily and Gwendolyn, who just fell in love with the name, and not the man behind it.
Hence, Jack is the symbol of the masks that Victorians would wear at home, while seeking pleasure and sin outside of it. He is Queen Victoria's ideal of an earnest man.....but just in the country. His double life represents what Wilde argued of his generation: That morality cannot or should not be imposed because once it becomes a rule to be followed,it also becomes a rule to be broken: And once it is broken (as Wilde did himself) it will tax the emotions and feelings of a lot of unsuspecting parties.