I don't think affordable-housing is actually considered a real "threat" to private developers in most of the nation, but suppose that it were.
Imagine that you had a business. The government says they'd like to fund a competitor.
It's not just any competitor! This new competitor will be empowered to use a ton of tax money to compete with you. This competitor will be headed by someone who is politically connected. The politically connected owner will be able to take a fat cut of this tax money, and donate it back to the political machine, to fortify their position. They can expect a cozy relationship with regulators and special approvals you can't get. If you're unlucky they will add legislation passed to support their business while hindering yours.
And, of course, their allies will insult you as villainous, greedy, and unreasonable. (Which you may be! And yet...)
Would you fight all of that, or would you embrace it?
— And if you think government projects aren't lousy with a corrupt politically-connected fat cats skimming money off the top, well, I have a delightful bridge to sell you!