The best explanation for why Mars' and Venus' surface temperatures vary, despite both planets having atmospheres that contain mostly carbon dioxide, is:
Mars has a thin atmosphere that cannot hold much heat.
Venus has a very thick atmosphere that creates an extreme greenhouse effect, retaining heat and leading to much higher surface temperatures compared to Mars, which has a thin atmosphere that cannot effectively trap heat.