What does the national anthem have to do with a sporting event that consists of mercenary players of two teams representing U.S. cities playing against each other? It's not an Olympic or international event where the teams are playing for national honor. And it's not a national contest where the winner is deemed to represent the whole country.
And in hockey and baseball especially, many of the players aren't even from the U.S. When St. Louis plays Boston in the NHL, maybe 15 or 20 percent of the participants on the ice are Americans. And when Detroit plays Toronto and two national anthems are played, again it's irrelevant to the event at hand as the U.S. isn't playing Canada.
I don't know if the playing of the national anthem is done before sporting events in other countries. Would be interesting to know if its commonplace or not. The main purpose seems to be to whip up unquestioning loyalty to the government. In the U.S., false, hyper-patriotism and nationalism has been ramped up considerably since 9/11 and the proclamation by village idiot George W. Bush, that everyone, in the U.S. and around the world, "are either with us or against us." And that's been the mentality animating the military/total surveillance complex ever since.