It's a huge mess of contractors, sub-contractors and consultancies. Enormous companies or consortia bid for these projects, government ministers have no freaking idea about software or technology so hire consultants to consult about hiring these consultancies and get thoroughly shafted in the process.
For example, check out the UK e-Borders system [1]. The spec, according to the article is
"Under the e-Borders scheme, immigration and government security systems will be linked with transportation hubs to check and log every passenger travelling in and out of the country."
On the face of it, it doesn't sound much more complicated than say the Diaspora project, and I'd fully expect a small group of YC-calibre hackers to put together a functioning prototype in a couple of months. It's obviously not that simple, but what do you expect when you hire a consortium consisting of Raytheon, Serco, Accenture, Detica, QinetiQ, Steria and Capgemeni [2]? Christ.
And how do you think the existing security systems that need linking to have been developed? Do you think there's an api?
[1] http://www.computing.co.uk/computing/news/2202536/borders-wi...
[2] http://trustedborders.com/about-us.shtml