In early England, one man would challenge another to a duel by slapping his face with a glove. The challenge was a serious matter of honour, and if the slapped man did not accept it, he would be branded a coward. Having a chip on your shoulder was kind of an early Wild West equivalent of the glove slap, though generally less mortal in nature.
Boys and men would place a woodchip on their shoulder, challenging anyone who dared knock it off to a fistfight. So, if a man had a “chip on his shoulder,” he was clearly in an aggressive mood and spoiling for a fight.