Wholeheartedly agree. There is a big push do this inside the US federal government right now. I work for the United States Digital Service, and at the Department of Veterans' Affairs, almost all application code we write is open source:
https://github.com/department-of-veterans-affairs
This push is happening in other agencies as well. Check out https://code.gov/ for other shared projects from agencies around the federal government.