As legend has it, singing the national anthem at sporting events began during the 1918 World Series, when the nation was at war. As recounted by the New York Times of Sept. 6, 1918, it was the seventh-inning stretch of the first game between the Chicago Cubs and the Boston Red Sox.
“As the crowd of 10,274 spectators — the smallest that has witnessed the diamond classic in many years — stood up to take their afternoon yawn, that has been the privilege and custom of baseball fans for many generations, the band broke forth to the strains of ‘The Star-Spangled Banner.’
“The yawn was checked and heads were bared as the ball players turned quickly about and faced the music. Jackie Fred Thomas of the U.S. Navy was at attention, as he stood erect, with his eyes set on the flag fluttering at the top of the lofty pole in right field. First the song was taken up by a few, then others joined, and when the final notes came, a great volume of melody rolled across the field. It was at the very end that the onlookers exploded into thunderous applause and rent the air with a cheer that marked the highest point of the day’s enthusiasm.”
The event had a public relations bonus for ballplayers in 1918, as there were people wondering why they were on the ballfield rather than the battlefield.
The idea caught on.
“Not to be outdone,” writes Marc Ferris in his cultural history of the anthem, “Red Sox owner Harry Frazee opened each game in Boston with it.”
Washington Post
President Herbert Hoover signed a bill into law making "The Star-Spangled Banner" the official anthem of the U.S. in 1931, giving the country a national anthem for the first time.