I'm wondering people started lifting weights for it's own sake. It seems like people wouldn't have always known the science behind it.
Just because people did not understand the science behind something does not mean the benefits were not observable. Plato, for example, saw great benefits in physical exercise 1 2. There are images in the Egyptian Beni-Hassan funerary chapel of people lifting bags over their head for exercise. The Tailteann Games in Irleand date to nearly 2000 BCE and include weight throwing competitions. The most popular story is perhaps Milo of Croton, who lifted a heifer every day until it was fully grown.
Bro-TL;DR Plato didn't skip leg day, neither should you.
I am sure Greek and Roman will show up in answers to this question, so here is something from ancient China instead:
Ancient Chinese texts in Han dynasty (about 200CE) mentioned two types of weightlifting activities: 举鼎 and 翘关:
举鼎: cauldron lifting, bronze cauldrons were important ritual wine or food vessels in bronze age China, the size varies, biggest one as we know weighs 0.8 ton. King Wu of Qin loved doing cauldron lifting and had several strongmen in his entourage, when he visited the capital of Zhou he attempted to lift the red cauldron there and failed, broke his shin and later died of his injury. (about 300BCE, See 史记-赵世家)
翘关: tilting city gate latch, at the time gates of Chinese cities used big wood beams as latch, and tilting it was a popular strongman event, 吕氏春秋 said Confucius was strong and could tilt the latch of state capital city. Later this event was standardized as part of Tang dynasty's military test (about 700 CE), in 新唐书: wood beam 17 feet in length and 3.5 inches in diameter, you hold one end with one hand, and the other hand cannot be more than one foot from that end, must lift ten reps to qualify.
I think the historical examples here are correct, but you should also consider where the modern approach to body building began.
Jack LaLanne basically invented and popularized our current idea of healthy diet and exercise, as well as the modern health club. In the 1930s, people somewhat knew how exercise was good for you, but the idea of building muscles was largely misunderstood. People avoided lifting weights because it was thought that building on too much mass would cause health problems. LaLanne knew this was wrong, so he began fitness clubs and passionately advertised them. He conducted public demonstrations taking volunteers, who were either overweight or underweight, and adjusting their diets and exercises so that months later they both showed clear positive results.
LaLanne developed a combination of diet and exercise that is essentially unchanged today. It seems obvious now, but these were revolutionary notions in the 30s - cut out sugar and fat and excessive meat, and eat more vegetables and nuts. Combine that with weight lifting, and you become an athletic hardbody who is healthier. His system worked really well, and his personality meshed well with television advertising.
The Greeks may have invented the gymnasium, but LaLanne re-invented it for the modern era.
Not to shoot down any other responses, but I might direct you to the appropriate section of the FAQ: