The best explanation for why Mars' and Venus' surface temperatures vary, despite both planets having atmospheres that contain mostly carbon dioxide, is:
Venus has a thick atmosphere which blocks heat from the surface.
Venus has an extremely dense atmosphere that creates a strong greenhouse effect, trapping heat and leading to very high surface temperatures. In contrast, Mars has a thin atmosphere that does not retain heat effectively.