Guardsmen do take an oath to protect the Constitution etc. I'm not sure its exactly the same as the regular military, but its similar. If a state seceded they'd have to hope their guardsmen were more loyal to the state than the USA. In reality it'd be a mix. And then, of course, the active duty military has all the best equipment. Far more people in the USA move between states, many than back during the actual US Civil War. Why would I be loyal to my current state of residence over the USA? I wasn't born here, and I didn't grow up here. Of course, were Trump to become POTUS then I'd likely choose New Mexico over USA. But likely a 3rd or more of the state guard would do the opposite.