The madness of the party
Hatter's conduct shows that the Tea Party isn't just mad (in the sense of it being a nonsensical occasion), but we learn very rapidly that all the rules, including time and space themselves, are being bent out of shape within this neverending party where nobody knows where to sit, no-one knows what time it is and, most importantly for Victorian society, the rules of civility are all going out of the window.
Into this we find Alice injecting herself into the party. First Hatter and the others tell her that there's no room. Alice ignores them and (against all protocol for a lady) seats herself at their table without permission. Hare pranks her by offering her some wine (an inappropriate choice of beverage at a tea party, to be sure) and then, when she remarks that she does not see it, follows up with the punchline that it's not available anyway! Alice remarks on the lack of civility and is reminded that she seated herself without permission and finally Hatter joins the conversation by making a personal remark about Alice's appearance, something that would have been unforgiveable in Victorian society.
This entire section of the book is rife with homophone and double/triple-meaning wordplay. The Hare said something rude and Alice didn't respond. In speech, the word would sound like "Your hare needs cutting" which could be interpreted to mean that he needs to be 'cut dead' (ignored) or that she needs to deliver a 'cutting' (hurtful) remark in response. This is a persistent style of joke in the work and one we see again and again in the book and its sequel (i.e. Mouse's "long and sad tale [tail]", Alice's "I have not! [knot]", "to turn round on its axis" [axes] etc).
Lest we fall into the trap of over-analysing the text, it's worthy of note that Alice's hair does need cutting, so Hatter's remark, although lacking appropriate civility for the occasion, is actually a pretty fair comment and something that a professional hatter might say to a client, especially one as young as Alice. This helps to establish his relationship with her as older/younger since he's speaking to her as one might speak to one's own child.
First, she [Alice's sister] dreamed of little Alice herself, and once again the tiny hands were clasped upon her knee, and the bright eager eyes were looking up into hers—she could hear the very tones of her voice, and see that queer little toss of her head to keep back the wandering hair that would always get into her eyes—and still as she listened, or seemed to listen, the whole place around her became alive with the strange creatures of her little sister's dream.
C.L. Dodgson's own illustration of Alice