Marriage was a popular topic for plays in Oscar Wilde's time. It's still popular in ours. Remember all those movies in which a young couple fight and break up, but make up in time for the credits? Same thing here. The characters mill around in a comic fog of misunderstanding and hardheadedness until their need for each other (with a little meddling) overcomes the odds. They learn to be honest, to forgive, to commit, and to give. In An Ideal Husband, marriage seems to be a generally desirable institution. Only the villain stays single.
Lord Goring's irreverence toward marriage and other respected institutions makes him the ideal problem-solver for the crisis of Sir Robert and Lady Chiltern.
Denied influence in the public sphere, women in Victorian England exerted influence through marriage.
The marriage of Lord Goring and Mabel at the end of An Ideal Husband is a contrivance put in to please the audience.