Comment OP must not work in the industry (Score 1) 236
or they could answer their own question. Three reasons:
1) Government already writes much of its own code. I see gigs posted all the time. Thing is, each office/department/etc tends to be a silo, so there is no "central" coding department. Can you imagine the bureaucracy around change processes then? Sheesh...
2) On average, public sector pays less. The idea here is to improve the quality of code, right? Not really possible if you can't attract the best and brightest.
3) Using external (this can be commercial or open source) products is key. Who makes the computers? Who makes the IDE's? How can we guarantee compiled code is fully secure if you aren't controlling every step of the process? Not possible. Even the government's most important asset, the President, is transported around in products made by commercial interests (albeit, with some customizations after the fact).