Maybe you need to get things in perspective. You are talking about fairly recent events. McCain ran for Congress as a Republican in 1982, so that's when, at the ;latest, he made his party choice.
I still say he's a natural Dem, but the anti-military sentiment of the Dems from the 1960s forward would have been difficult for McCain to stomach with his background.
You are talking about events of the 21st century, after he'd been in Congress about 20 years.
His mentor (from his own words) was a Dem., and if you look at his voting record, and graph it vs time, the makeup of congress and importance (factoring in vetos and whether there was a veto threat prior) what you find as the top 3 indicators are:
(1) "stand out from the herd-ness". An example is prior to Congress flipping during Clintion. He voted w/the Rs mostly, and his high CU comes mostly from that period. He didn't vote with the Rs if the leading lights of the Left voted against the Rs but enough of the remainder voted the same as the bulk of the Rs and there was no veto threat or there threatened to be a majority that could over-ride a veto.
(2) Expanding Socialism. As long as it didn't outweigh his standout factor, he voted to expand the fed gov and toward socialism.
(3) reelection timeframe. within 6 months for high visibility and 3 months for low visibility bills that were inline with campaign promises he started voting favorably.
Well, looking at the time, I see I'm out of mine. Gotta go on duty... have a good day! Great chopping bait with you!