The US flag has a sad history of being used to compel patriotism. One low point occurred in 1940 when the Supreme Court, in the throes of World War II, ruled in Minersville School District v. Gobitis that religious dissenters could be forced to salute the flag in the name of national unity (or, for example, be expelled from school).

With what was seen as the blessing of the Supreme Court, a wave of persecution was unleashed upon “traitorous” Jehovahs Witnesses, including arson and lynching. (Ironically, they were accused of being Nazi sympathizers, despite the Nazis themselves sending hundreds of Witnesses to die in concentration camps.)
Three years later, the Supreme Court overruled its own decision, saying that forced speech was an infringement on free speech and that constitutional rights were “beyond the reach of majorities and officials” (West Virginia State Board of Education v. Barnett).
To learn more, see:
- Minersville School District v. Gobitis (Wikipedia)
- Famous Dissents: Minersville School District v. Gobitis (PBS/WNET “The Supreme Court”)
- A Matter of Conscience (American Treasures of the LoC)
- David R. Manwaring: Render Unto Caesar: The Flag-Salute Controversy. U. Chicago Press, 1962.
Just a quibble, but the US didn’t enter WWII till December, 1941. The war started in 1939 of course, but the US was still technically neutral in 1940.