The genius of this title depends on a pun between the adjective "earnest," meaning honest or sincere and the first name, "Ernest." So let’s focus on the first definition.
Wait, we’ve already run into a problem. Not one character in the play seems to care about telling the truth – whether it’s about their names, where they’ve been, or any other detail of his or her life. If Oscar Wilde were a predictable writer, we’d expect these crafty liars and dishonest people to get what's coming to them in the end. But, Wilde isn’t that predictable. Instead, he throws in a twist that makes this play interesting, clever, and hilarious all at the same time.
Our protagonist, Jack Worthing, isn’t as innocent as he first seems. At the very beginning of the play, we learn that he has created a convenient younger brother named Ernest. We don't know why he comes up with that particular name, but we’re guessing Jack had a laugh or two over it. Jack, a.k.a. Ernest, fools the his lady friends, all of whom have an obsession with the name, "Ernest." Both Gwendolen and Cecily are in love with that name, based on an assumption that boys named Ernest will be as honest as the name suggest.
Here’s where the other definition of "earnest" becomes relevant. Ironically, there is no character named "Ernest," but everything depends on pretending to be Ernest. Trouble ensues when Algernon (Jack's friend), who has his own version of Ernest (a friend named Bunbury), catches on to the scheme and shows up at Jack’s country manor impersonating Ernest, just as Jack decides to kill off his pesky younger brother. To summarize, we now have two different girls in love with Ernest; Ernest doesn’t exist, but is being impersonated by two different guys. At one point he’s supposed to be dead in Paris but is instead dining, alive and well, with Cecily. He’s engaged to Gwendolen, but wait, he’s engaged to Cecily too!
Finally, things start to unravel and the truth is revealed. We’d like to say the Jack and Algernon are finally being earnest, but they can’t really take credit for the events that occur. When Jack’s identity is finally revealed, he still doesn't know what his name actually is. But then he find's out that his real first name is Ernest. And his middle name is Jack. So he really has been "earnest" the entire time. The ending, where Jack cheekily tells Lady Bracknell, "I’ve realised for the first time in my life the vital importance of being earnest" (III.181) is ambiguous. Is Jack saying that he’s learned the importance of being honest, or the importance in being name Ernest?
Here’s the beauty in the play. Gwendolen is just as smitten with him when he's lying Ernest as when he's honest Ernest. The much-anticipated truth reveals that Jack was right all along. So much for earnestness. On the other hand, the truth earned Jack a legitimate place in the aristocracy, a younger brother, and Lady Bracknell’s acceptance of him as a son-in-law (more on this later). So there’s an argument to be made for telling the truth.
Now what about being named Ernest? It's just as important to be named Ernest in the end as it was in the beginning, since Gwendolen still insists on loving an "Ernest." So you could read the play either way. Either Jack really does learn the value of honesty at the end, or he simply clings tighter to the importance of being named Ernest.