The machines test for traces of explosives, not explosives - after the first alarm on his shoes, the shoes would have gone through the X-Ray and been subject to a physical inspection
I'm not sure why they would have bothered to test the shoes more than twice, anyway... Well, fifth time's the charm!