These two bags make up the fecal containment assembly which is part of the personal hygiene system assigned to the astronauts for use during the Apollo missions. These bags were flown on the Apollo 11 mission in July, 1969. Because they were not used, the crew returned them to Earth.
The system is self-contained, giving the astronaut as much flexibility and control in a weightless environment as possible. It was designed to permit for hygienic disposal of fecal matter, though it was far from perfect.
NASA transferred this object with others from Apollo 11 in 1971.