Compare the relationship of Jack and Gwendolen with that of Algernon and Cecily.
Although on the surface it appears that the relationships between Jack and Gwendolyn and Algernon and Cecily are similar, they are actually quite different. It is true that both are based on deception since neither of the men is really named Ernest. However, Jack and Gwendolyn actually have known each other for a while and have been courting. He's been truthful except for giving her a false name, which, ironically does turn out to be his name after all.
Algernon, on the other hand, has borrowed the false identity of Jack's brother and found out where his country home is in order to find out more about Jack and his ward Cecily. For Algernon, the irony comes when he discovers that Cecily has actually created a relationship in her diary with her guardian's nonexistent brother.
Both Jack and Algernon are enough in love with their ladies to be willing to change their names to Ernest in order to please them.