According to an article I came across today, hard-to-pronounce sounds in languages might have developed to show who belongs to particular groups and who doesn’t.
Apparently ancient tribal groups recognised that such sounds are a good way to identify ‘insiders’ and ‘outsiders’, something they considered very important, as the sounds can only be made properly by those who have grown up speaking a particular language and pronouncing the particular sounds of that language. This is especially true of the clicks found in languages in southern Africa. This is possibly why some languages have a lot more difficult-to-pronounce sounds than others, and perhaps applies most to languages spoken in linguistically and culturally diverse regions – this last speculation is my own and doesn’t appear in the article.