When most people think about open source, the government doesn't immediately come to mind. However, governments the world around have an important role in both developing and popularizing a variety of open source software. Here's an overview.
Why Open Source?
Open source has several distinct advantages for governments over proprietary software:
The most conspicuous of these during the global recession is the difference in cost. Licensing fees for proprietary software can be incredibly expensive. Overall cost savings can be huge as well, once things like support and training were taken into consideration. While this may be a small sliver of overall government spending, it is still easy savings, easily made.
Additionally, open source provides a serious security advantage. This may seem somewhat contradictory at first: if everyone can see the code, can't it be taken advantage of more easily? However, having the code open to communal criticism also allows it to be quickly patched for any security issues that are found by endeavoring programmers.
The infinite flexibility and customization is also an advantage, especially for highly specialized government use. Proprietary software just can't provide that. Solutions are also developed at an accelerated rate, in part depending on the community to help in the process, and in part because they work from pre-existing open source standards, making interoperability easy to achieve.
For more advantages of open source for the government, and examples of said advantages, check out this OSS Institute paper.
Government Use of Open Source
What is the biggest way in which governments contribute to open source? By using it! The more users of open source out there, the more open source projects are encouraged to grow and develop. This is the single biggest role that government plays in the open source movement.
There are few governments in the world where open source is not used in some small way, from running their servers on the LAMP stack of Linux, Apache, MySQL and Perl or Python, to running Linux distros on their computers, to using Open Office and other open source applications for day to day work.
The degree to which open source is integrated in government varies considerably, however.
In some countries there is a direct mandate to use open source whenever possible, for instance in Brazil. As you might guess, it is in these countries that open source use is the most common - Brazil, South Africa, Germany and the UK. It's a worldwide trend, and a well documented one.
Other countries, such as the United States, have no such requirements. However, even in such countries, there are generally departmental mandates that individually define whether proprietary or open source software is to be used. The US Department of Defense, for instance, actively encourages the use of open source software both for budget concerns and for greater security. Some municipalities take the initiative and move to open source before federal mandates as well, such as Vancouver BC.
There are innumerable lobbying groups out there, plying the advantages of open source software to governments against the big boys like Microsoft or Apple. A recently formed group is Open Source for America, which consists of companies such as Red Hat and Sun Microsystems to the end of pushing open source software in government structures. The push seems to be working: the Obama administration is looking into integrating open source more fully (and more officially.)
Government Development of Open Source
Historically, governments themselves are also developers of open source software, especially with regards to the sciences. NASA simply would not be the same without its dedication to open source software, for everything from Mars rovers to World Wind - for a complete listing check out their open source project page.
It's not just limited to strictly research applications either, however. The US Department of Defense is a regular user and developer of open source - most of the development goes into using open source scripting tools and libraries to develop some of the most highly secure software in the world. This even includes the launch of Forge.mil, a site where many of the military's open source projects may be viewed and critiqued by the general public.
For more on the relationship between open source software and the government, check out this Bright Hub article.