> Walking out may feel good, as righteous indignation so often does, but it doesn’t help your situation
I think that walking out of these situations is not so much a sign of giving in to righteous indignation but more of a way to abort a situation that has already become unsalvageable. In this case, the prospective employer making demands like these is in itself a glaring signal that you don't want to work at this place. Continuing to sit at their table after voicing your disagreement in the absolutely ridiculous "hope" of getting a job offer is not only a waste of time for both sides, it's a surefire way to be humiliated. Might as well leave while you still have the high ground.
Back in the day when I was occasionally interviewing people for positions I came across utterly incompatible applicants quite often, and sometimes those interviews were extremely uncomfortable for both parties. Actually, I wished more people walked out of my interviews when I myself could not.
And then walk out.
Even if I refused and were offered the job anyway because of my excellent convictions, I wouldn't want to take it, because the culture is one that defaults to extreme mistrust. That's the same reason I did walk out of a job interview requiring a drug screen even though I don't do any drugs.
If I've got a drug or booze or facebook or gambling problem, it will impact my work in a visible way. If it doesn't impact my work in a visible way, then it isn't a problem, is it?
Offer to log in for them and let them look around. Say, "After all, you wouldn't give me your password if I asked, would you?" You might even get bonus points if you have "Login Approvals" enabled (the six digit code sent by text message).
I guess this is the best course of action for most people. But us in the tech industry are in the perfect, and perfectly privileged, position to nip this right in the bud by walking out and explaining our rationale, if only because we can easily get another interview at a company which won't engage in this idiocy.
No reason to allow it to become widespread in the first place.