Why gold foil?
Keeping your house comfortable does not require rocket science technology. Aluminum is a more affordable material and equally efficient in reflecting radiant heat energy. When you see a space contraption draped in gold foil, remember that the foil is probably a heat shield or, more practically, a radiation shield.
Gold is used by NASA in all kinds of contexts. It’s used in external reflectors like those seen in these photos, but it’s also found in astronauts’ visors, filtering out IR radiation to protect astronauts’ eyes.