Medrash Tanchuma (quoted in Rashi on 25:17) notes the proximity of M'chiyas Amalek and Middos V'mishkalos, explaining that one who deceives others by using flawed scales and measurement instruments is destined for divine punishment at the hands of the enemy. What is the deeper relationship between sinning in the realm of Middos V'mishkalos and retribution (at the hands of Amalek), to which the Medrash alludes?
Deceiving customers by utilizing flawed measurement tools is unlike other forms of cheating and stealing. In cases of "regular" monetary dishonesty, the businessman or thief obtains unlawful gain either entirely without the knowledge of the victim (such as Genevah - stealing in secrecy) or with his knowledge (Gezelah - robbery, Kovesh S'char Sachir - not paying a worker when required, Kofer B'pikadon - denial of a bailment, etc.). Violation of the laws of Middos V'mishkalos, however, involves crookedness at its worst, for the businessman uses a scale or measuring device to show his purchaser in "good faith" that the goods are verified as to the amount agreed upon, while at the same time the system is rigged to falsify the amount for the seller's benefit. The seller's hypocrisy is unparalleled. He wishes to appear as honest and does not dare rob the customer outright, yet he takes advantage of the trust he attains to stab the purchaser in his (financial) back.
This is precisely where Amalek fits into the picture. Amalek symbolizes and actualizes brazen denial of Hashem. Whereas Amalek is scared of man, it has no fear of God and openly defies His word. (While Bnei Yisroel were traveling, Amalek came from behind and attacked the weak Jews who trailed in the back [25:18 with Rashi from Tanchuma]). Amalek would not take on Bnei Yisroel unless it knew that there was vulnerability, yet it did not hesitate to blaspheme openly (see Rashi ibid).
The relationship between Middos V'mishkalos and Amalek emphasizes in a unique way that we must be ever aware of the "Eye Above" which is watching us, so as not to disregard God's surveillance of our actions and concern ourselves only with what other people may think and know. The relationship of these mitzvos serves as an affirmation that any dishonesty and denial vis a vis others ultimately reflects a lack of belief in God Himself, for one who cheats thinks that he can get away with his misdeeds so long as his victim is unaware and there are no witnesses to the act; this itself denies God's omniscience and indicates a core lack of emunah.