Edit: I meant specifically humans.
This is a common misconception. These traits are not likely due to modern medicine (which is very, very new compared to the scale of human evolution). The environment plays a big role, but there is always a distribution of traits in a normal population, some good, some bad. Not to mention that what we might be self-selecting for must change very rapidly as civilizations rise and fall, preferences shift like the winds, and ethics rapidly evolve. I think this misconception can be dangerous, because of what you mentioned. Eugenics.
Again, I specifically said that I prefer to have a compassionate society over a (maybe) genetically superior one that practices eugenics. The tradeoff is unquestionably worth it and you’d have to be very callous to disagree.
Also, I never said that medicine was the sole reason. On the contrary, I said that it’s social society (which medicine is one of many results of) as a whole and a general disposition towards keeping your loved ones alive even if they can’t hunt. That’s much older than medicine. It’s literally a cornerstone of what a society is.
I hear you, but genetic change at the level of these diseases and traits can take on the order of hundreds of thousands of years or more to accumulate into meaningful trends. Social society is a part of that process, in the way it might be for other social animals. If social dynamics tend to result in communities harboring vulnerable individuals, then there is probably some selective advantage to that behavior, not the other way around.