I haven't been able to figure it out either. My best guess is that the "integral and indispensable" was interpreted from the point of view of an employer, when it should have been interpreted from the point of view of the employee.
Amazon could eliminate the security check entirely with no adverse effects on the employee's work. From Amazon's point of view, it is easily dispensable. The employee's cannot opt out of the security check without being fired. From the employee's point of view, it is entirely indispensable.
Though not stated, I'd guess that there is also an unhealthy amount of efficient market hypothesis thrown in. If I assume that all markets are at equilibrium, then no company would have workers perform unnecessary work, because those workers would then choose to work somewhere that doesn't.
Edit: It may also be that the Court wanted to avoid extending existing law, and instead wanted to point out limitations in it for Congress to then amend. I'd have to read the transcripts in detail there, which I haven't done.