Simple reason? They sound cute.

Well, there is no explicit rule to repeat the same character in the name.
However, it’s not uncommon to see the repeated characters in the real names and nicknames.
The reason being that the Chinese parents would often spend a considerable amount of time deciding/thinking the names/nicknames of their (upcoming) kids.

The logic to choose the names are often decided based on historical and cultural significance.
For example, one of my female friends is named 杨莹莹.
杨 (yáng) – is a surname.
莹 (yíng): jade-like stone

The name 杨莹 is totally fine to be the name of a girl. However, 杨莹莹 sounds more cute to the natives. Further, 莹莹 can also be a nickname of a Chinese girl irrespective of her name.
There is another little girl whose nickname is 笑笑 (xiào xiào): double smile.
A boy can be named as 明明. Since 明 means bright, 明明 means “double bright” (meaning undoubtedly, obviously). Repetition in these examples emphasizes a good quality.
Nicknames often contain repeated characters, as they sound cuter. However, repetition is not necessary. For example, there are two twin sisters in my neighborhood, one is nicknamed 小芒果 (Little Mango), and another is nicknamed 小苹果 (Little Apple).
Then, there is another little girl nicknamed 小橙子 (Little Orange). She is not related to 小芒果/小苹果.
Point being, these names don’t contain repeated characters.