Deuteronomy 25 covers a few different stipulations.
The first is a prohibition against excessive beating as punishment. The limit is set at forty stripes. This calls to mind the forty days of rain at the flood and the forty years wandering in the wilderness. These were the maximum punishment and an effective cleansing of the sins of the former generation, that is, it wiped them out entirely. The forty lashes as a maximum are a sign of putting to death the body of sin so the man himself might be saved.
A man who refuses to raise up a son for his dead brother is cutting off his brother’s name from the land. It is an attempt to take his brother’s land inheritance for himself. He receives spit in the face as a sign of shame for his refusal to provide seed, and his sandal is pulled off which removes his protection against the curse of the ground. So for grasping for what is his brother’s, he stands to lose his own as well.
The next section is also an attack on the seed. If a woman grabs a man’s parts in a fight, she is attacking his ability to have children, thus cutting off his inheritance in the land. She is also cutting him off from entering the worship assembly, as expressed 23:1. This law is paralleled in Exodus 21 where men fighting cause a woman to give birth prematurely. If the baby is unharmed, the man would just pay a fine. But if there is any harm done, the man would pay life for life, eye for eye, tooth for tooth.
Unequal weights and measures are just pure theft. This is despising the other person and their right to their property, grasping for what is theirs. It is hatred of man and God and is a refusal to acknowledge that all things come from Him. It is an abomination, a detestable thing, like spoiled food that you spit out of your mouth.
The Amalekites had thought to pounce on the spoil of Israel as they fled from Egypt. Again, the punishment is life for life, eye for eye, tooth for tooth. They had tried to cut off Israel, so they themselves would be cut of from under heaven.