After the Civil War, there was a movement to promote the National Anthem, the Flag and the Pledge to the Flag to reunify a divided country, and one way of doing this was promoting these patriotic expressions n public schools. The South was way behind the North in public education, and many communities before the War had no schools at all. My father was a Methodist preacher's kid in the Texas Panhandle, and after the sixth grade, he and his brother were sent back to Gainesville to attend school. because small panhandle towns did not have schools that went beyond the sixth grade.
That is how these patriotic symbols became a part of school rituals. The pro sports people simply copied this.