Mars can hold an atmosphere just fine, idk what you're talking about.
Most of the martian atmosphere is CO2 and water vapor, and both freeze when it's cold enough. That's exactly what happens. The martian poles are so cold that the atmosphere freezes there and causes the martian polar caps. The atmosphere is there, just frozen.