Then why are the capital cities of Missouri and Oregon so much more Republican than the rest of the state?
I can't comment on Madison, but I used to live in Salem, OR.
Salem would be a very conservative town if not for state government employees. As it stands all 3 county commisssioners are republicans and the county, dominated by salem, nearly always votes republican in national elections.
Reasons Salem is more conservative:
-no big public or private universities.
-Much higher average church attendance than the rest of the state. Remember, Oregon is #50 in church attendance. This leads to a greater % of social conservatives.
-Salem is the center agriculture in Oregon. Farmers, at least out west, tend to be pretty conservative bunch.
-There are no big union (besides government) employers in town.
These factors, I believe, make Oregon's state capitol lean republican when conventional wisdom would tell you is should be strong republican.