Ptolemy's theory of planetary motion

The red planet turns in a circle, whose centre turns in a larger circle around the Earth. This "circle-within-a-circle" motion does produce the retrograde motion that is observed ... but why would a planet move in such a strange fashion?