The best explanation for why Mars' and Venus' surface temperatures vary, despite both having atmospheres that are mostly composed of 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 that traps heat and results in extremely high surface temperatures. In contrast, Mars has a much thinner atmosphere, which is less effective at retaining heat, leading to cooler surface temperatures.