Why is Mars' atmosphere so thin? Is it because there isn't life to exhale enough oxygen and carbon dioxide? The size of Mars is about the same as Earth, so isn't there enough gravity to hold enough air?
The escape velocity of Mars is about $5.03 \mbox{ km}/\mbox{s}$ , that of Earth about $11.2 \mbox{ km}/\mbox{s}$ , that of Moon about $2.38 \mbox{ km}/\mbox{s}.$

The escape velocity is an important ingredient for the stability of a planetary atmosphere.
From this it's not surprising, that the density of the Martian atmosphere is between that of Moon and that of Earth.

The loss of most of the magnetic field of Mars makes its atmosphere less resistant to erosive solar wind.

(Actually things get more complicated, since sequestration and outgassing, meaning an exchange of atmosphere with rock, as well as sublimation, and resublimation of water and carbon dioxide take place. Water vapor is decomposed into hydrogen and oxygen by photolysis, hydrogen escapes to space due to its low molecular weight, and oxygen tends to be bound chemically to iron-bearing rocks. On the other hand solar wind provides a steady supply of hydrogen, which is bound by rocks in the top few micrometers; "ChemCam saw peaks of hydrogen and magnesium during the first shots that we didn’t see in subsequent firings.")

The history of the Marsian atmosphere isn't yet known in full detail. NASA's MAVEN mission is designed to find out more.