Answer: Because of Wartime Traditions
In order to understand why we sing the national anthem before virtually every American sporting event, it’s helpful to understand the backstory of this patriotic jingle. The TLDR version is that back in 1814 an American lawyer, Francis Scott Key, witnessed the bombardment of Baltimore’s Fort McHenry on September 13 and 14, and also the subsequent American victory and the sight of the American flag flying high in the morning. Filled with pride he crafted a poem (“The Defence of Fort McHenry”) that was later set to a tune, and then published in the local newspaper.
Over the course of the next one hundred years, the song would go on to be played at Independence Day celebrations, be adopted by the Navy during the rising of the Flag, and ultimately ordered to be played at all military ceremonies in 1916 by President Woodrow Wilson. For all intensive purposes, the song had become our national anthem, although maybe just not officially yet. That would all change during America’s entrance into World War I, and then solidified during America’s victory in World War II, and it would start on the baseball diamond.
See, according to Mental Floss, “After America’s entrance into World War I, Major League Baseball games often featured patriotic rituals, such as players marching in formation during pregame military drills and bands playing patriotic songs. During the seventh-inning stretch of Game One of the 1918 World Series, the band erupted into “The Star-Spangled Banner.” The Cubs and Red Sox players faced the centerfield flag pole and stood at attention. The crowd, already on their feet, began to sing along and applauded at the end of the song.” The pride was so tangible that the band not only played the tune during the next two games, but they began playing it before the start of every remaining game that season for the Boston Red Sox. During World War I and World War II, President Herbert Hoover signed a bill to make the “Star Spangled Banner” the official national anthem for the U.S. on March 3, 1931, broadening its reach and legitimizing it around the country.
Finally, during the Second World War, baseball games once again became a center stage for pride and patriotism while the Allies attempted to defeat the Axis powers overseas. This called for our hymn, the Star Spangled Banner, that unified our nation-state and by the time the great fight was over the tradition of taking our hats off and facing the flag had become a sewn into the fabric of our country.