Iodine is further down group 7 than chlorine. Their group number only describes the number of electrons they have in their outer shell. As iodine has a higher atomic number than chlorine, it also has more electrons in its electron shells. Even though they are divalent molecules, iodine has more electrons per molecule than chlorine which means that iodine has more contact surfaces for intermolecular forces to act on between individual molecules.
Despite intermolecular forces being a weak individual force of attraction, collectively they are very strong and the numerous forces between iodine molecules means that more heat energy is required to break these intermolecular forces and separate the molecules therefore iodine is a solid.