I don't buy the class analogue.
Aside from the racial (magical) view being perfectly consistent with everything in canon (magical/non-magical seems to override even xenophobia, witness the foreign schools' reception in Goblet of Fire), we also have a perfect example of one group of people who suffers from both class and racial discrimination: the Weasleys.
The Weasleys are presented as being mocked (particularly by the Malfoys) both for being poor - lower class, note also that their red hair suggests Irish roots - and for linking themselves with Muggles and eventually intermarrying with Mudbloods. If the 2 were one and the same, we would not see any difference.
I can't really pretend to be much of an expert on Harry Potter - I've seen several of the movies but I've never read any of the books. From what I've seen however the parallels to class in British society are clear while the racist connotations are less apparent to me. Discrimination based on physical features common to an ethnic group seems to me to be an essential component of racism which is largely absent in the movies.
In Britain wealth and class are correlated but distinct. The concepts of the nouveau riche and the distressed gentry are examples of how the concepts of wealth and class are not identical.
Update: Please post new comments in the latest HPMOR discussion thread, now in the discussion section, since this thread and its first few successors have grown unwieldy (direct links: two, three, four, five, six, seven).
As many of you already know, Eliezer Yudkowsky is writing a Harry Potter fanfic, Harry Potter and the Methods of Rationality, starring a rationalist Harry Potter with ambitions to transform the world by bringing the rationalist/scientific method to magic. But of course a more powerful Potter requires a more challenging wizarding world, and ... well, you can see for yourself how that plays out.
This thread is for discussion of anything related to the story, including insights, confusions, questions, speculation, jokes, discussion of rationality issues raised in the story, attempts at fanfic spinoffs, comments about related fanfictions, and meta-discussion about the fact that Eliezer Yudkowsky is writing Harry Potter fan-fiction (presumably as a means of raising the sanity waterline).
I'm making this a top-level post to create a centralized location for that discussion, since I'm guessing people have things to say (I know I do) and there isn't a great place to put them. fanfiction.net has a different set of users (plus no threading or karma), the main discussion here has been in an old open thread which has petered out and is already near the unwieldy size that would call for a top-level post, and we've had discussions come up in a few other places. So let's have that discussion here.
Comments here will obviously be full of spoilers, and I don't think it makes sense to rot13 the whole thread, so consider this a spoiler warning: this thread contains unrot13'd spoilers for Harry Potter and the Methods of Rationality up to the current chapter and for the original Harry Potter series. Please continue to use rot13 for spoilers to other works of fiction, or if you have insider knowledge of future chapters of Harry Potter and the Methods of Rationality.
A suggestion: mention at the top of your comment which chapter you're commenting on, or what chapter you're up to, so that people can understand the context of your comment even after more chapters have been posted. This can also help people avoid reading spoilers for a new chapter before they realize that there is a new chapter.