It’s a flag families put up when someone in the military, in their family, dies while deployed. A flag with a blue star means they are deployed, but alive.
Your guess is incorrect. When people lose a loved one, they are grieving and will choose to put up a flag if they want. It’s not mandatory, it’s not an award, and not given by the Pentagon.