The best explanation for why Mars' and Venus' surface temperatures vary, despite both having atmospheres that contain mostly carbon dioxide, is: Mars has a thin atmosphere that cannot hold much heat.
Venus has a very thick atmosphere, which creates a strong greenhouse effect, trapping heat and resulting in extremely high surface temperatures. In contrast, Mars has a much thinner atmosphere, which means it cannot retain heat effectively, leading to much lower surface temperatures.