I'd like to address the main part of this question--the "why" part. This is related to my response to a similar question--"Why do languages have different syllable complexity from one another?"
In general it's difficult to answer questions of the form "Why do Languages with property X have that property?" or "Why do languages that lack property Y lack that property?" with any synchronic explanation, or even with any unified historical explanation. Usually the best we can do is say, "...because that's how those languages evolved over time."
Since the current state of any language is the end-result of an evolutionary process over time, most properties of the language came to be through that evolutionary process. One common view of diachronic change is that voicing contrasts, tonal contrasts, length contrasts, etc. are constantly lost and gained in the phonology, principally due to reanalysis of the input by language learners from generation to generation, which results in the constant changing of the phonological inventory of that language (morphology and syntax can change through similar processes of reanalysis as well). Inventories can also be expanded or changed through the influence of contact with other languages.
In rare cases the historical explanation may have a clear-cut physiological basis. For example, if one were to ask, "Why doesn't ASL (American Sign Language) make use of any audible speech sounds?" we could respond, "...because the community in which ASL was developed lacked the ability to perceive such sounds."
In some other cases, certain sounds may be considered more "marked" than others because they take more effort or are more difficult to produce than others. We may glean some clues from the order in which babies begin to produce certain sounds (generally labials are produced first, and labials are very common in the world's languages, for example).
Diachronic explanations like the ones above (and the detailed perceptual account provided by @jlovegren) can potentially explain the source of the loss or gain of a sound in a particular language, but (excluding the ASL example) they don't explain why some languages have been susceptible to such pressures and others haven't.
Also, from a synchronic point of view, the precise makeup of an inventory of a given language is arbitrary. In slightly oversimplified terms, the main requirement of an inventory is that it enable the language user to encode a sufficient number of contrasts for defining separate lexical entries for the various morphemes and words the language user needs to store in the lexicon.
In other words, as long as a language has enough different sounds to differentiate among the various words in that language, it doesn't matter what those sounds are, and there's no rhyme or reason to why one language uses one set of sounds and another language uses another set of sounds, other than reasons having to do with the historical evolution of those languages.
So the "reason" that 525 of the languages in Maddeison's survey lack a "th" sound is likely to be different from language to language--in most cases the languages from which these modern-day languages descended probably lacked a "th" sound (perhaps because it is marked from an articulatory perspective); in other cases languages may have had a "th" sound at one time but lost it due to the fact that it got reanalyzed as a dental stop instead of a fricative; in still other cases the "th" sound may have gotten reanalyzed as a different fricative, like /f/ or /v/. One would have to examine each language on a case-by-case basis. If there is a particular language you have in mind, you should post another question about that specific language.