It's a referrence to Le Petit Prince by Antoine de Saint-Exupéry. It's just as delightful in English as French and I highly recommend you read it in any of the 300 languages it's been translated into.
From the Wikipedia article:
Upon encountering the narrator, the little prince asks him to draw a sheep. The narrator first shows him his old picture of the elephant inside the snake, which, to the narrator's surprise, the prince interprets correctly. After three failed attempts at drawing a sheep, the frustrated narrator simply draws a box, claiming that there is a sheep inside the box. Again, to the narrator's surprise, the prince exclaims that this is exactly the drawing he wanted.
I call it the "Duolingo twist." Regular sentences can get boring. Odd phrases are put in these courses for fun.
It could be either. It is used for meat, but also for an animal if you do not know or care whether it is a male or female sheep....in fact the word brebis - ewe is used more often. This is French logic, because the flocks of "sheep" that we normally see running around in the fields are actually flocks of ewes. In the same way, the French versions of black sheep and lost sheep are 'brebis'.
Does "box" mean the same as "pen" here? Unless it's referring to toy sheep, I'm having a hard time figuring out how this is possible.
A "pen" for animals is generally "un parc". "Un parc à moutons" = a sheep pen.
When vets treat large animals, they put them in a box to keep them still.