It's a business decision.
Some companies prefer to have a highly variable workforce. This allows them to grow/shrink the teams rapidly based on project needs. It also relieves them of having to pay a "bench" of workers.
Having a mostly-contracted force of programmers means it's far easier to bring in new people, and it's easier to get rid of them. The problem of attracting talent is shifted from the company itself to the manpower agency. The problem of letting people go (and any subsequent severance obligations) is also removed from the company.
Particularly when the company's core competency is not software, this seems to be a growing trend.
Some very large companies in several business sectors have taken this approach. I happen to work in the financial services sector and have seen this happen more and more over the years.
I'm not saying that I think this is a good idea, or that programmers are anywhere near as fungible as some companies seem to believe these days. I'm just answering your "why they do it" question.