A Chinese American person recently told me she had better listening skills in Chinese than English (note: not listening comprehension, but just listening, or speech sound recognition). It's surprising because she was born and grew up in the US, never living in a Chinese speaking country except for short periods. She admitted that her conclusion may have a confounding factor that both her parents are Chinese immigrants and speak clear Mandarin to her at home. I told her that her better listening may be related to the fact that the tone of Chinese, or any tonal language for that matter, offers a high interference immunity. This means that the listener can discern the speaker's tone even if there is ambient noise, if the speaker does not utter syllables clearly, or if the distance between the speaker and the listener significantly reduces the sound volume. Under less optimal conditions, if different tones of a sound in the language alter the meanings of the sound, there will be less loss of information carried to the listener because the tone is more immune to interferences than other phonemic features of the sound.
So, the tone of a language is a desired feature. But why is that only some languages are tonal? According to this 2015 article Climate, vocal folds, and tonal languages: Connecting the physiological and geographic dots, tonal languages are generally distributed in humid regions of the world, while non-tonal languages are in arid or dry regions. To produce tones, the human organ requires a favorable ambient environment, and "very cold/dry regions apparently serve as barriers to the spread of (complex) tone".