Because it's kinda obvious. Weight lifting is known to gain muscle. Lifting weights train your muscles causing them to grow bigger. The bigger they are the stronger you get. This does not mean that it swimming does not build muscle, It does, But not as much as weight lifting. Reminder: All muscles can be grown from weight lifting.
Swimming is good for cardio ans the shoulders and core. Plus there is less resistance on your muscles.
However you need to know how to swim and you need a pool that is long enough and you can only do a few swimming patterns and you can only do more laps you cannot train harder only longer.
With weights you can adjust the weights. You can lift with 5 pounds or 20 pounds and you can do a lot of different forms. The cons are that you need weights and that you need to be careful not to hurt yourself and others with heavy iron and not to overdue it and tear your ligaments.
Personally I would lift weights and just run around to due cardio, I do not like getting water in my ear and being wrinkly after swimming. I would rather be sweaty.
One time I hurt my back and had no choice but to swim, It was good on my back and joints because of the 0 gravity, But I lost muscle tone because I was unable to lift with the back injury.
I started to gain muscle mass again after my back healed because I was able to lift weights again.
So for muscles I would say (for me anyway) lifting weights is "better" for muscles.
I am a 17 year-old female competitive swimmer, And I can do more push-ups than my dad or any of my guy friends; so I'm pretty sure swimming works your muscles sufficiently well. Also, Swimming is a low-impact sport, So the only injuries you usually would get are overuse strains. Weight lifting is extremely high impact and injuries are very common.
I think that swimming is better for your muscles because with swimming you are moving you're kicking you legs so that really builds up the muscles in both your arms and legs. With weightlifting yeah you could weight lift with your legs I have seen it done before but mostly it is for you to lift up with your arms
While swimming is less practical then weight lifting, You can continue it throughout your life, Even through injuries with modification. Weight lifting is great to develop muscle mass or target specific muscles but it isn't always going to raise your heart rate up.
Last i checked heart related death is right there with cancer and while weightlifting is great in conjunction with another cardio based workout, It won't meet the cardio demands most people do.