The output may be correct. You don't say anything about what is in front of the ping sensor at each position. If there is nothing near the sensor at the 180 degree position, and there is at the 0 and 90 degree position, the output could be correct.
What version of the IDE are you using? What pins are the servo and ping sensor connected to?