Public shame and malice towards individuals who violate expected norms is actually a fairly good deterrent toward would-be bad actors. I'm sure there are many millions of instances per day where people decide not to do untoward things because they care about their reputations.
But on the flip side, you are also correct. It's important that public attention also be directed towards the systems that incentivize and enable bad behavior, and the people who create those systems. Patching laws, shaping incentives, and empowering a distributed system of judges and courts to handle violations is ultimately much cleaner, fairer, predictable, wide-reaching, and (therefore) more effective than disorganized mob-led shame campaigns.
Unfortunately, several things work against this:
1. It requires much more time, education, intelligence, and emotional self-control to care about system design over simply shaming others. These four things aren't abundantly common in most populaces.
2. Lawmakers and politicians have their own incentives to redirect public attention away from themselves. And they can take advantage of #1 to do this, which is basically what demagoguery is.
3. Similarly, media companies have their own incentive, which is to increase clicks and shares and subscribers. And appealing to base emotions with strong headlines works 100x better than discussing complex laws and systems. Research shows that the #1 emotion that leads to sharing online is outrage.