The best explanation for the difference in surface temperatures between Mars and Venus, despite both having atmospheres that contain mostly carbon dioxide, is: Mars has a thin atmosphere that cannot hold much heat. Venus has a thick atmosphere which blocks heat from the surface.
Venus has a very dense 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 is less effective at retaining heat.