That was Citizens United. The key distinction is between campaign contributions and independent expenditures.
Let's say you really dislike Hillary Clinton, and you want to help fund negative ads about her. One option is that you could donate money to her opponent's campaign, and her opponent will use the funds to create negative ads (or just blow it all on hats). You can do this to a limited extent if you are an individual, but you can't do it at all if you are a corporation or a union. Corporations are barred from contributing to federal election campaigns. This is perfectly constitutional because the Constitution doesn't provide a right to donate to campaigns.
Another option is to hire some actors and a director and make the ads yourself, and then buy a few spots during "America's Got Talent" to air the ads just before the election. You can do this if you are an individual, but if you are a corporation or a union, this was made illegal by McCain-Feingold. In Citizens United, the Supreme Court held that that part of McCain-Feingold was unconstitutional because the First Amendment bars the government from discriminating against certain speech based on its content -- especially based on its political content. If people want to make ads or movies about politicians, they can do so free of censorship. Moreover, if people want to donate money to corporations or PACs for the purpose of making ads or movies about politicians, they can do that as well. The Constitution doesn't provide a right to donate to campaigns, but it does provide a right to free speech, even if the speech is about politicians. Corporations, unions, and other organizations (including PACs) can speak freely as long as they don't coordinate their activity with the campaigns themselves. (My understanding is that this isn't enforced very well, and plenty of PACs do coordinate to some extent with campaigns.)
In Citizens United, a non-profit corporation made a movie about Hillary Clinton and wanted to buy air time to show it on some cable channel. The FEC said, "No, you can't do that. It's about Hillary, who is running for federal office. We don't allow corporations to publish speech about candidates right before an election." The Supreme Court said, "Yes, actually, the First Amendment says that laws can't discriminate against political speech. If they're allowed to air a movie about the Kardashians, they should be allowed to air a movie about Hillary Clinton as well." (Not a direct quote.)
The corrosive effect of special-interest money in politics is a huge problem, but you can see how it's challenging to limit people's ability to spend their own money spreading messages about politicians (as opposed to donating their money to campaigns) without running afoul of the Constitution. Any law that says, "You can make a movie about the Kardashians, but not about the Clintons" should be constitutionally DOA, IMO, which is what Citizens United said.