No legal or official requirement exists to remove your hat during "God Bless America."
However, many consider it a sign of respect—similar to the National Anthem ("The Star-Spangled Banner") or the Pledge of Allegiance—especially at sporting events, patriotic ceremonies, or military functions.
Irving Berlin (composer) intended it as a "peace song," not a national anthem substitute. Etiquette is personal/communal, not codified.