A couple of weeks ago I was working on a Server Side Dom Parser for imperfect markup, and I realized while doing it that I could extend it to display HTML sent to the user with more organized markup. At first, this sounded like a good idea, but after thinking about it for a little longer, I decided against it.
As a programmer, organized code is very important to me. Which is not to say that I'm a style nazi, I don't care how many spaces you indent blocks with (but it better be atleast one), I don't care if a brace comes at the end of a statement, or on the next line, and I don't typically care if you use the right textcase for variables. What I do care about however, is that you're consistent. I can pick up a style pretty quickly from looking at something you've coded, and adapt to it. But if you're switching back and forth, you're going to drive me crazy.
The problem is, when HTML is hand coded, consistency is easy. When HTML is dynamically generated, you can waste a lot of time trying to get it to fit in with the rest of the document. When I see any code, even code I'm not going to work with, if it's organized poorly, it will bug me. But, 99.999 percent of people who see a website won't care at all how the code is organized. They want a site to load fast. The people who will be working with your code, will most likely have the server side copy, and rarely if ever look at the client side generated code. (Not to mention, for those that will, there are extensions for Firefox that can do it for you, such as Firebug)
However, I believe there is one (at least) exception. If you're working on a program that will be used by others to generate code (such as a WYSIWYG editor), you should try and ensure that editing the output of that is as easy as you can make it. I've worked with both good and bad WYSIWYG editors, and so far every single one has had bugs, but the ones that generated a clean, readable output have been the easiest to fix.
To summarize, if you're spending time trying to organize dynamically generated code, (or worse, spending users time in increased load times), to the benefit of only a sliver of the people who will see your site, you've made the process more important than the goal, and you need to reevaluate.
(As a sidenote, this can also apply to comments. Don't make users download your notes if you can help it. When you can, stick them in server side comment tags.)
How important is the cleanliness of client side code?