The UK government's annual investment in digital technology is riddled with oversight issues, a former official has said.