Why is it vital that atoms in the same sample are all given the same charge? Mass spectrometry
This is a misconception that during ionization, each ion must get a +1 or +2 charge. It is desirable to have +1 so m/z corresponds to the molecular mass of the ion or its fragment. The state of ionization heavily depends on what you are using to ionize your target analyte. For example if you use electron impact, you will see fragments mostly with +1 charge. However in other techniques called matrix assisted laser desorption (MALDI), the state charge can be as high as +12 and so on. They are detected as such. In electrospray ionization, +2 is also common.

There is no way a mass spectrometer "knows" a priori the state of charge of an ion. All charge ratios are detected. However it can distinguish the sign. It depends on the user whether negative or positively charged ions reach the detector. Some ions are better detected in positive mode and some in negative mode.