There are three reasons for the hilarious scene at the beginning of Act II when Marlow and Hastings converse with Mr. Hardcastle believing him to be an innkeeper who has ideas above his station. Firstly, there is immense humour in this scene, which relates to the theme of appearances vs. reality that is so predominant in this play. Marlow and Hastings believe that Mr. Hardcastle is an innkeeper, whereas actually he is the owner of the house and Marlow's future daughter-in-law. Thus to have Marlow ignore him and to treat him dismissively as if he were a servant is hilarious. Note the kind of request that Marlow makes of Mr. Hardcastle:
What, my good friend, if you gave us a glass of punch in the meantime, it would help us to carry on the siege with vigour.
To demand a glass of punch (not the refined drink that Marlow would be expected to drink in fine company) was definitely rude as Marlow is, of course, treating Mr. Hardcastle as if he were a servant.
Secondly, and to support the theme of appearances vs. reality. Mr. Harcastle has been led to believe that Marlow is shy and retiring. This of course is completely at odds with his current behaviour, as Mr. Hardcastle observes:
This is the most unaccountable kind of modesty I ever met with.
Of course, Marlow is not being "modest" at all, and this irony is a chief source of humour as the true nature of Marlow is something that both Mr. Hardcastle and his daughter, Kate, have to discern in the rest of the play.
Lastly, this scene exposes the class system in England at the time and the ways in which the upper classes treated those below them. The accident of birth has always been such a massive indicator of the life chances an individual will have, and the class system in England is something that undeniably is one of the most famous examples of this. Goldsmith may not have originally intended to critique the class system through this scene, but the modern day audience certainly is very aware of this alternative reading.