I don't know about you but I see these programs on TV all the time. They spend so much money building extravagant houses for people. But who pays for it, and how do they earn that money back?

The short answer is:

The show is funded by the network, in this case ABC. These homes, built in such a quick time, may cost $500-700,000.

That might seem like a lot. Let's compare to some other show budgets:

"Friends" in the later seasons cost $10 Million per episode, as each of the stars were making over $1 Million per episode.

"Frasier" cost $5 Million per episode.

There are many others that cost even more.

Extreme Makeover: Home Edition required no locations other than that of the "winner", no cast other than Ty and crew which was the same every time, no sets, absolutely no special effects to speak, not a single "artistic" lighting scene, or anything.

You pay the cast (none of which were huge celebs), you pay the crew, you build a big house in a week. All in all, you have spent way, WAY less money than a single sitcom episode. reality type shows are super cheap to create relative to scripted TV. You're not paying script writers, big name actors, set designers, renting locations, special effects, etc. The hosts make good money, but not star of sitcom/drama money by a long shot. The participants do it for free. There are not a bunch of locations that require moving truck loads of equipment for a 30 sec scene. So your labor costs are a tiny fraction of scripted TV, and the construction costs are probably less than an actual show that needs sets, on-location set-ups in many places, etc.

The remodels are partially subsidized by products mentioned or that buy sponsorships. Then the shows have ad time in them that is sold.

So a production company spends $100k on a remodel, $100k on crew & host, $50k on post production. Then they sell the episode for $300k to HGTV, who sells $500k in ads against it (might only be $50k per airing, but they run each episode like 5x a week when new, and run re-runs later on).