Originated in World War II. When something was “good enough for Government work” it meant it could pass the most rigorous of standards. Over the years it took on an ironic meaning that is now the primary sense, referring to poorly executed work.
I thought it always meant anything that could barely squeak by.