The genius of this title depends on a pun between the adjective "earnest," meaning honest or sincere, and the name "Ernest." Oh, Wilde! You wit!
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 pretty much any other detail of their lives.
At the very beginning of the play, we learn that Jack 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 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 suggests.
Ironically, there is no character (initially) 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.
We now have two different girls in love with Ernest... and 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 that Jack and Algernon are finally being earnest, but they can’t really take credit for the events that occur. When Jack’s identity is revealed, he still doesn't know what his real name actually is. But then he finds out that it is Ernest. 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 of 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 a man named Ernest (because she's a weirdo). Either Jack really does learn the value of honesty at the end, or he simply clings tighter to the importance of being named Ernest.