You need to distinguish between actual sadism, which is a sexual fetish where consenting participates dominate and humiliate each other for arousal purposes and shadenfreude, where people experience humor or delight from seeing others' misfortune.
Actual sadism is heavily tied to the domination/humiliation fetishes that make up a large part of many other fetishes (petrifaction, watersports, bondage, vore, etc.). You could almost say it's refined domination/humiliation with none of the bells and whistles other fetishes add to it. It's also one of the very few fetishes that can actually be enacted IRL.
To wonder why it's popular is to wonder why domination/humiliation itself is popular. It's a difficult thing to answer since it lies at the base of so many fetishes. I would say the easiest answer is the relative versatility of both. You can get arousal from either the victim or the perpetrator. You can cause the two to flip roles and wring out a little poetic justice with little effort. You can play up or tone down the severity of things depending on the scenario.
It's not a perfect answer to the question, but it's at least something.
As to shadenfreude, it usually comes in one of two flavors: the arrogant and the stupid. When someone does something stupid (ride a skateboard down a hill and over a ramp), you enjoy seeing their stupidity rewarded with its natural conclusion. Likewise, when some acts arrogant (my team will win and your's sucks!), it's equally enjoyable seeing their arrogance rewarded with failure.
This is why real tragedies like train crashes almost never invoke shadenfreude--there's usually very little stupidity or arrogance on display and if there is, it's quickly overwhelmed by the fact that that stupidity or arrogance likely got someone innocent killed and the shadenfreude is quickly replaced with anger.
I just want people to stop hurting each other.
Actual sadism is (in the vast majority of instances) practiced by consenting parties--usually the one on the receiving end is aroused by being on the receiving end. Shadenfreude, meanwhile, is entirely passive. You watch the event happen but you have no control over it's outcome (like a Youtube video or news article).