There were three reasons for that.
First, China is a large country. I don’t mean large, I mean large. Huge. Vast.

Image 1. Map of Asia. As easily visible, China is huge. Almost twice the size of India!
The emperors of China had problems maintaining their reign over the border regions, with bandit gangs terrorizing trade caravans for centuries. The problem was so severe that a huge wall was built to safeguard the northern regions and establish a secure trade route to central Asian states.
I am almost certain no Chinese emperor had seen all of the land under his reign. They were perpetually embroiled with troubles and issues inside China to ever want to expand their territory.
There were rogue governors to set right. Highwaymen and bandit gangs to eradicate. Oh and not to forget, conspiracies and schemes within the palace to keep an eye on.
There’s a Punjabi proverb succinctly summarizing the situation: جیڈا وڈا سر، ایڈی وڈی پیڑ, meaning: the bigger the head, the bigger the headache.

Image 2. The bigger the crown, the heavier it weighs down.
Whoever in their right mind would want to accumulate more headache and troubles by merging in more regions to his domain?
Secondly, in which direction would the Chinese emperors try to expand?
East: sea. Beyond the sea, Korea. Beyond Korea, Nihon/Japan with fierce warlords and too far away to control.
North: Mongolia. That’s where they built the wall, to keep those raiding gangs and bandits out. Mountains and grasslands only. No fertile plains or irrigation networks supporting crops which could be taxed.
West: Afghanistan. Again, barren mountain ranges, fierce warlords, no crops. Also the culture of Afghanistan was and is absolutely in contrast to that of China. There was no way that region could be controlled from within China.
South: Tibet, India. While Tibet was indeed annexed when the emperors enjoyed periods of stability, they wouldn’t even think about going further south. Himalaya mountain range is still a formidable barrier to cross for an army, even with modern technology. In the past it was utterly unthinkable.

Image 3. Where to expand into?
Third and last reason was that China was a fertile and prosperous region with enough produce to tax. It also lay smugly with the silk road and trade routes between India and central Asia. It was easy to tax the trade caravans in exchange if providing safe passage and protection from bandits.
These are the reasons why Chinese emperors never wanted to expand their territory.
Simply put, there was no initiative. They already had all they wanted (and more) within China.
China did fight many regional wars, as has every other nation in human history! This was normal.
However, few nations have ever tried to build a far-ranging empire. There was Rome, and the Ottomans, and Portugal, Spain, Netherlands, France, Great Britain, and Soviet Union.
If China was so inclined, it could’ve joined this exclusive club. In the 15th century, China had the largest naval fleet in the world. Led by the legendary Admiral Zheng He, the fleet consisted of over 300 vessels, 62 of which were gargantuan ships that totally eclipsed Christopher Columbus’ ships!

Carrying a large contingent of warriors, He could’ve conquered many lands. Instead, he sailed his mighty fleet all the way to the East coast of Africa on diplomatic missions.
China has always been insular, preferring to keep to itself. As long as it had regional security, China did not care about the rest of the world.