Another reason might be due to the prevalence of semantic code highlighting in modern IDEs. Dark backgrounds have a bit of an advantage if you are looking for several discernibly different and readable foreground colors.
Also, the common reason given may not be the whole explanation even if it is technically correct. Yes, dark backgrounds are easier on the eyes in a dark room but that doesn't explain why so many devs seem to prefer coding in the dark. My hypothesis? Attention Deficit Disorder (dark room focuses you on the screen) and Autism Spectrum Disorders (light sensitivity is a common symptom) are pretty common in techies. Also, a higher proportion of us are likely night owls -- partly because statistically night owls have higher IQs than early birds but also, again, because ADD and ASD favors working in isolation after everyone else calls it a day.