Oil only started being discovered in Alaska in 1968 and that year Nixon won Alaska by just 1% and has been strongly republican ever since.
https://en.wikipedia.org/wiki/Alaska_Native_Claims_Settlement_Act#Effect_of_land_conveyancesNixon signing this native claims law allowed development on drilling and the transport of Oil in the state ever since. And afterwards there was migration from the rest of the country to oil industries and industries that were helped by the economic demand created from the oil industry which made the same people who moved and their descendants vote GOP because of opposition to the Democratic platforms recently that had a focus on Climate change which included restrictions on green house gas emissions.
As for why he didnt win California as much, SoCal excluding LA. which used to be the bastion of the republican party didnt swung towards him as much as other parts of the state did.