The phrase "to fit the crime" means that the punishment or consequence for a wrongdoing should be appropriate and proportionate to the severity of the offense committed.
Sentences with «to fit the crime»
Did the punishment fit the crime in the Early Modern Period? (tes.com)