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 a strong greenhouse effect, trapping heat and leading to extremely high surface temperatures. In contrast, Mars' thin atmosphere is less effective at retaining heat, leading to much colder surface temperatures.