The Story
Our cavemen ancestors were stupid and uncivilized.
Unable to construct shelters, these large, brutish and ugly creatures used caves for protection and habitation. They ate mostly meat, and used animal skins for clothing.
Thousands of years later, they evolved into modern human beings.
Facts
The whole concept of cavemen is a myth.
It's true that archaeologists have found many examples of our ancient ancestors living in caves, and it's true that along with their remains were animal skins, and gnawed bones. But the caveman myth confuses cause and effect.
Our ancient ancestors were just as intelligent and civilized as we are now. They constructed buildings, they wove cloth, they cooked food.
Occasionally, under difficult times such as war or famine, families were sometimes forced to leave their homes and seek shelter elsewhere, just like modern refugees. Most would have lived in tents or built temporary shelters from trees in the forest. Later, wind, rain, ice, and other natural forces destroyed all evidence of their presence.
But some of them happen to have found convenient caves as their temporary refuge. And some of those caves happen to have been permanently cool and dry, providing perfect conditions for preserving whatever was left in them. Their woven clothing and wooden tools might have rotted away, but their stone tools, bones, and animal skins, sometimes along with their own remains, were preserved until the present age.
It's not that our ancient ancestors all lived in caves, it's that the few people that were forced to live in caves happen to be the only ones whose remains and artifacts still remain.
2500 years ago, Greek society developed geometry and other forms of mathematics; they measured the diameter of the Earth and Moon, and even calculated the distance between them; they constructed amazing buildings, some of which are still standing today; and they produced beautiful sculptures, literature, and other forms of art. Those ancient Greeks were hardly our intellectual or societal inferiors, so why should we think that they were so superior to their own ancestors a few thousand years before them? There is no reason for stupid, ugly, and brutish creatures to suddenly transform into the glory that was Greece.
Why
In the late 19th century, the common people were exposed to Darwin's theory of evolution, and with the recent explosion of scientific discovery, they were familiar with the concept of things improving with time. They imagined that, since they themselves were the peak of perfection, their ancestors must have been stupider and uglier.
When cave artifacts were discovered, it was natural to conclude that they provided a fair representation of their ancestors.
They obviously should have known better, but why would they want to?
Believing that they were better than these ancestors was comforting and reassuring. Imagining these creatures as primitive, especially if they looked a little like some modern non-European people, reinforced the belief in natural European superiority.
And once the concept had asserted itself in popular culture, no one wanted to give it up. Certainly not the advertising industry, or racists, or even people that simply enjoy watching The Flintstones.