The races targeting incumbent Republicans morphed into a high-stakes political fight with national implications as tens of millions of dollars poured into the state.