They're not the only beneficiaries. I can think of a few moderately-wealthy foreign-born H1Bs (and equivalent) living in Northern California who might have half a million spare and wouldn't mind buying a $500K house and getting a free greencard if it'd save them the trouble of going through the usual immigration process. Picking, just as a random example, say, me.
I'm not even sure whether I want to remain in the US long term, but if offered a free greencard I'd say yes.
The direct beneficiaries are American homeowners, who get higher prices for overvalued assets and financial institutions holding housing as collateral. The losers are lower-income Americans (often also recent immigrants) for whom the cost of housing remains out of reach.
I'm not even sure whether I want to remain in the US long term, but if offered a free greencard I'd say yes.