This suit and others like it are Musk's attempt to leverage his immense wealth to silence critics, despite his claims of being a free-speech absolutist. Throwing out this nuisance lawsuit was the best way for the courts to discourage Musk from continuing to pursue legal action to squelch free speech, and empower organizations like the CCDH to continue their work without fear of legal repercussions.
Legal action is the only way for Musk to fight back against advocacy groups that disagree with the content on X. These groups attack the platform by telling advertisers lies about the content and then threaten those companies into pulling their money. Those groups are the true opponents of free speech and Musk has no choice but to sue them for putting the financial future of X in peril.