The story
From gold star (“(attributively) relative of a United States soldier when the latter has been killed in action”) + wife. Gold star refers to stars of that colour traditionally shown on service flags displayed by families of members of the U.S. armed forces.
Etymology from Wiktionary, CC BY-SA 4.0.