People work out for a variety of reasons. Working out due to vanity is not a new phenomenon . I think it's safe to say that most people want to look good and feel good about themselves.
That's a very strong motivator. Along with a new awareness of concepts of good health and longevity of life.
Decades ago this was rarely discussed & considered very seriously by most people. Today's food guidelines hardly existed. Even the dangers of smoking were still being hotly debated. Trust me, I lived through it.
And the emphasis in exercise for personal health purposes was almost unknown. Most exercise was related to some kind of sports, your primary motivation being to be competitive. The idea of exercise for its own sake, as a healthy pursuit, was hardly known.
Exercise for school children started to come into vogue during the Kennedy Administration. With a formal National Fitness Program. Part of it was Cold War driven, the idea that Americans were getting too flabby & weak, and would be unable to defend the country against the Commie threat. https://www.jfklibrary.org/JFK/JFK-in-History/Physical-Fitness.aspx
Today societal standards and vanity play a large role. But so do medical studies that prove that being fat and out of shape can be a cause of you suddenly dropping dead of a heart attack at too early an age. This kind of empirical evidence wasn't as firmly established decades ago.
It's getting more attention today. More people are trying to follow good health guidelines. My only problem with them is they keep changing, especially about diet. During my lifetime certain foods have been declared good, bad, good, bad, and good again. It does shake your confidence in the pronouncements of these "experts".
But I'm also sure they'll eventually get it permanently correct, as the science improves. More importantly, people WANT to do what's right, with a greater appreciation for these issues. Whereas when I was growing up, nobody hardly had a clue, nor gave it much thought. You ate as you liked, and only exercised if you were interested in doing serious competition. Gyms were for athletes, not for the rest of us.
And our bodies looked as they looked. The natural outcome of age and heredity. Other than makeup for women, and some rudimentary work with plastic surgery, you accepted what life dealt you. To quote the comedian Flip Wilson from the 1960s, when doing drag: "What you see is what you get!" That applied to yourself as well as to others.