In some places it's a tradition that some are happy to carry on. In Scotland for example, it was historically traditional to name babies after someone, resulting in a fairly narrow name pool until the advent of film, which introduced a wider variety of names. The older naming patterns were soon dropped but many continued to used family names in some form or another, e.g. by including them as middle names, and some adopted patterns still in use today. I know quite a few families who always name the first son after the father, and yes, it is unusual to hear of new baby Gary or Stewart in amongst all the Arlos and Noahs, but there is also something touching about having unbroken link to your ancestors.
More directly, it's not generally that confusing as people will often be known as
different versions of the name e.g. a family with many Jameses (very common inn Scotland) will usually have a Jim, Jimmy, Jamie, Jamesie, Wee James, Old James, Wee Jim, Big Jimmy, Hamish etc. So everyone always knows whose being talked about.
My name, also my mother's name, has been used for women in my family for at least two hundred years, and I like that it's unusual in my peer group, and also that I can look at a person in my family tree from nine generations back and think, "I'm named after her".