It's ridiculous that one would ever be made to be separated from one's wallet. If required to remove it from my pocket, I hold it and let the officer check it by hand, counting the cash before and after.
I've also insisted on keeping my valuables in view as they exit the X-ray machine. Without fail the TSA has responded rudely. I lock all compartments before sending it through.
Seth