I'd doubt that most slim people who go to the gym go to show off their slimness. Many people are slim because they've been going to a gym, or at least because they pay attention to what they eat and/or burn off more calories than it would take to make them gain weight (in other words, slim people are often active, whether or not they go to a gym or not). Inactive slim people may want to go to the gym to firm up their muscles or to increase the amount of exercise they get (because being slim doesn't always mean being fit and healthy when it comes to toned muscles or getting a healthy amount of exercise).
It's pretty much said (by experts in the medical/health field) that if there were a way to prescribe exercise the way medicine is prescribed, exercise would be THE most effective way for a person to dramatically increase her chances of remaining healthy in a number of different ways. People who go to the gym often know that. Some like the structure. Some want access to the equipment.
People who live in the suburbs may find walking and biking is difficult on some roads. People who live in the city may not feel comfortable in traffic or bad neighborhoods. Many people don't want their exercise routine to depend on the weather, and lots of them live in apartments, where real workouts would bother whoever lives downstairs. The list of possible reasons goes on and on.
I really think that people don't think much about their own "slimness" unless they're not slim. People with "weight issues" in one degree or another are often always thinking about their own and other people's weight. Slender people often just have healthy eating and exercise habits, and otherwise do their thing and don't think a lot about their own or other people's weight. (There are, of course, slim people with eat disorders or bad body images; but healthy, normal, slim people. ) Besides, some people may be surprised to learn how insecure a lot of slender people really are about one thing or another about their appearance. Being slender doesn't always mean being confident and proud of one's own body.