score:16
I’m thinking I should rephrase my comment above as an answer. I believe the correct answer would be “they didn’t”, and that’s why.
While the surname and name of Cao Cao almost match in modern Mandarin (except the tone is different, Cáo Cāo, so they don’t), the similarity is but a figment produced by the language development that led to modern Mandarin. He was active in the 2nd-3rd centuries AD, when the accepted language was some kind of intermediate between Old Chinese and Middle Chinese. Even in “Middle Chinese” (Pulleyblank-Miyake reconstruction), representing an approximation to the refined spoken manner of early 7th-century Chang'an, much later than his life, his name is rendered /d͡zaw t͡sʰaw/; yes, they rhyme, and both have level tone, but they're are not identical, being with drastically different initial consonants (the leveling of those made the tones different now).
However, as mentioned before, he lived even at an earlier date, before the development of Middle Chinese, and spoke some late Han language. As for the Old Chinese rendering for his name, it would be (Baxter et al.) /N-tsˁu [tsʰ]ˁawʔ/, without a hint of any similarity; but even to the later Han period, it was something akin to /dzou tsʰau/ – for Old Chinese poetry, they wouldn’t have even rhymed.
To conclude: the fact his finals matched was an accident of several centuries after his life; the match of the initials was another accident of the dialect that grew into the modern normative language (and not universal, cf. the pronunciation of his name in Shanghainese as Záu Tshǎu). Hence, it would be strange to suspect he was given his name with any knowledge of the future development of the language.
Upvote:5
Several points to be made here:
As the other answer mentioned, the names are far from identical. Linguists would probably categorise the language spoken at Cáo Cāo's time as Eastern Han Chinese. The Old Chinese reconstruction (Baxter-Sagart, 2014) would be /*N-tsˤu [tsʰ]ˤawʔ/.
As given in the Records of the Three Kingdoms, the only description of his name is (unhelpfully) "surname Cáo", "taboo name Cāo", "courtesy name Mèngdé".
太祖武皇帝,沛國譙人也,姓曹,諱操,字孟德,漢相國參之後。
Records of the Three Kingdoms, Volume 1
The founder of the dynasty was the Martial Emperor. He came from Qiáo in the principality of Pèi. His surname was Cáo, his taboo name was Cāo, and his courtesy name was Mèngdé. He was a descendant of the Han chancellor Shēn.
Any other claims about his name are from third-party sources. Most notably, the contemporary Biography of Cáo Mán, written in one of the kingdoms of Eastern Wú, makes several other claims:
Cáo Cāo's infant name was Ā Mán (hence the title of the Biography);
The surname Cáo originated from one of the Yellow Emperor's descendants;
The State of Zōu was owned by the Cáo clan, granted to them by King Wǔ of Zhōu.
Since there doesn't appear to be anything on the given name Cāo, it is ahistorical to speculate why his given name is Cāo.
Not related to the question, but there are some other things incorrect about the question and other answer:
"曹 has no meaning"
This is not true, 曹 originally depicted two bags (東), indicating the meaning pair, group.
"Middle Chinese" ... representing an approximation to a refined spoken manner of early 7th Century
Middle Chinese was not a spoken language, but a compromise between Northern and Southern topolects codified in rime dictionaries.