To be fair, the TSA doesn't know that the guy is a pilot - only that he has the uniform and some sort of identification that says he is - both of which could be faked.
Unfortunately nothing is likely to change until it's not isolated incidents of people refusing to go through the full body scanners but rather 10% or more of the flying public. --I'm estimating, of course, but can you imagine the backlogs if just 10% of passengers refused every day and forced the TSA to spend time frisking them?