Could teaching at community college for a few years harm my career?
I'm worried that it would create a record of affiliation with a low-ranked university that would make people see you as "from" that university, and thus be biased against hiring you. Is there any truth to this? 


I think it depends when you do it.  If it is in between your master's and PhD, as you somewhat tentatively suggest: well, I know many people in my academic field (mathematics) who paused in between degrees to teach at the high school level, most commonly for two years.  I have seen absolutely no stigma attached to this.  On the contrary, when people have to make lightly educated guesses as to whether a certain candidate will be a good (read: not problematically bad) teacher, then holding a teaching job for more than one year pushes that guess in a positive direction.  Teaching at a community college is generally viewed as a "higher level job" than teaching at a high school, so I think this should carry over.  As a specific example, within fairly recent memory we took a PhD student who had been teaching at a community college.  She got her PhD and now has a tenure-track job at a university.  So: no stigma here.  

(The above answer assumes that you have made it into a PhD program and have kept up your "higher academic skills" as much as other candidates.  Whether that is the case is up to you.)

The part of your CV after you get a PhD will be viewed with much more scrutiny, both in terms of chronology and specific jobs held.  If you want to get a tenure-track job at a research university, any post-PhD academic employment other than a postdoc or tenure track job at a research university will count against you.  (Sorry.  I don't make the rules -- I'm just reporting the situation as I see it.)  Even taking an industrial job might not count against you as much as teaching at a community college: in my neck of the academic woods an "industrial job" is an enigma of blankness eliciting neither delight nor scorn -- our eyes just slide right off of it.  

Let me say though, that while teaching at a community college between degrees is a possible trajectory to an academic career, it does not necessarily make sense to me for someone to plan on that in advance.  That is to say: why are you contemplating taking a break of several years from your graduate studies?  If the answer is because you feel a bit burned out or that you want the chance to figure out whether an academic career is for you, I think you need to know that the post-PhD academic job market is one step shy of airtight at the moment.  It is not for the faint of heart or the uncertain of commitment.  I suggest you think carefully about your long term goals and whether a PhD is really a necessary part of them.