Oscar Wilde's plays, essays, and even his one novel The Picture of Dorian Gray are still relevant in the 21st century because Wilde places specific emphasis in developing the traits of his characters throughout the plot, more so than letting the plot dictate the fate of his characters.
This being said, the plot of The Importance of Being Earnest pales in comparison to the complexity, uniqueness and cleverness of the two main characters in the play, Jack and Algy. One can almost forget what the play is about and, instead, choose only to focus on the relationship between Jack and Algernon, or on what goes on during those secret visits in which they both engage as part of their respective double lives.
This is where the relevance comes. Jack and Algernon share behaviors that people have exhibited through generations and still exhibit to this day: Indiscretion, the search for who we really are, marriage versus convenience, the want for mischief and, of course, Wilde's favorite and most resounding topic of argument: The masks we wear versus our true identities.
We can connect Jack to every man who has ever had to embark on a mission for which he is not ready. In his case, he is given an estate and the guardianship of young Cecily upon her father's death. Jack is a young bachelor with no parental experience, nor parents of his own. To take care of this huge endeavor means to give up a lot of oneself. Jack cannot just give up his youth and desires, so he invents a fake bad brother whom he "needs" to visit far away in London.
Similarly, Algernon is a man equally in love with freedom. He also loves money, good food, a good life, and not having to pay for anything. He also leads a double life for the sake of staying away from family responsibilities towards his very snobby aunt. He does not apologize for his actions. He is who he is, whether the world likes it, or not.
Then we also have the issue of marriage. In The Importance of Being Earnest marriage is a byword for convenience and caprice. None of the females in the play wish to be married for love, but because of their silly obsession with the name "Ernest". This shallow treatment of marriage is perhaps more as resonant today as it is in Victorian times. With modern marriage proving to be a failed paradigm and a torn institution, the treatment given to it in the play is much alive today indeed.
Therefore, the combination of human weakness, shallowness, lack of readiness, and double identity makes for a number of topics that are as relevant then as they are now.