Lots of good advice already. Here are my thoughts as a partner in a law firm:
When a summer associate comes to work, I am first interested in whether their work (research, analysis, writing, and spoken communication). I want to know whether they will be capable (in an absolute can-he/she-do-it-or-not) of doing the work that we do. Is he/she smart enough?
Next, I want to know whether they will be willing to do the kind of work that we do, in the kind of quantity that is needed. Summer recruiting time is mostly sweetness and light. Day to day practice is closer to trench warfare. While nobody expects a summer associate to grind out 200 hours a month during the summer, it's not a bad thing to see them stay late to finish a project on time. Leaving early to attend a social function when the project due the next day is not ready? Bad. Really bad.
Then, I want to know whether they will be willing to put their clients' interests (and the firm's) ahead of their own. This is somewhat related to the prior issue, but it has other aspects. Sometimes, we have to sublimate part of our personality in the interest of protecting or catering to our clients. I have a particular personal writing style. Sometimes I have to alter it because of the court that I'm appearing before. Does that hurt? A little. But it's what the client needs, so I do it. I have certain political views. Sometimes I have to keep those quiet, or even express sympathy for a contrary view (without lying, of course), in order to cater to the client's preferences. Does that hurt? A little. But it's what the firm needs, so I do it. I do have a social and family life, and not infrequently have weekend plans. Sometimes I have to abandon those because of some exigency (real or perceived). Does that hurt? A little, and sometimes a lot. But it's what clients, firms, and courts need, so I do it.
And this factor is where clothing first enters into the question. Your firm, your clients, and your courts will have certain norms and expectations of how to dress. Those norms may be less hip or fashion forward than some young lawyers personally prefer. If they are smart, those young lawyers will bend their preferences to suit the desires of the firm, clients, and courts. Not so much because clothing is directly important, but because it demonstrates a willingness to be a part of the team. If you play a team sport, and show up for a game out of uniform because your think the colors are unflattering, you are a bad teammate. If you come to the firm dressed in overtly-sexual, fashion-forward clothing (even if it nominally complies with dress codes by being a suit), that sends a bad signal.
The next factor is whether the summer associate has a demeanor that will "play" with clients. This is one where a bit of projection (in the professional sports scouting sense) is required. Relatively few summer associates are socially polished and professionally confident enough to be ready for prime time with clients from day one. But you have to see that they are coach-able in that direction. Coming in dressed like a rube, or a jersey boy, or some other stereotype sends a bad signal in this department.
Finally, the last major factor, I think, is whether the summer associate will be enjoyable to work with over the long haul. Firms place varying degrees of importance on this - some are looking for kindred spirits, others are looking only for a "not an a$$hole" level of fit. Clothing can play a small role here, and this is the first factor where a bit of creativity or style in your clothes can be favorable - but only if the firm values style and creativity!
Some final thoughts: Remember that the practice of law is a profession that values seriousness. Being older is an advantage, youth is a disadvantage. Young people are used to the goal of "dressing up" to be attractive to the opposite sex. That's irrelevant in the practice of law. You dress up to be dignified. Nobody expects summer associates to have a bunch of first-rate clothes. They expect them to dress in uniform, in a way that doesn't look as though they've never worn a suit before, and in a way that does not detract from whatever air of seriousness a 23 or 27 year old can have. You don't have to dress as, nor be, a stick in the mud, but take care of business first. Within a couple of weeks, you'll have a good idea of how far out on a limb you can go (in terms of dress, jokes, demeanor, hours, etc.).
Over time (and I mean years) you can bank enough trust and confidence that many of the restrictions on dress fade away (at least when you're in the office with no judges or clients). But as a summer associate, you have earned nothing.