A staple diet refers to a diet that consists of foods eaten regularly. A staple can refer to a piece of thin wire driven by a stapler through sheets of paper to fasten them together. The joke is referencing a goat that is eating office supplies, so consuming a "staple diet" could mean consuming a diet high in staples (thin metal wires) or a diet high in regular foods. 
A goat that ate office supplies was on a staple diet .