Mars has such a thin atmosphere because it lacks a magnetic field, the solar wind from a distant (relative to the Earth-Sun distance) Sun stripped away most of its atmosphere.
Compare to Venus, which is much closer to the Sun and therefore is blasted with a much stronger solar wind, Venus has a hugely thick atmosphere, and also lacks a magnetic field.
Extra points for anyone that can spot the incongruity...
Active core?