People like to blame the US government for this, though I think the real culprit is that often the dumber, more xenophobic members of society are usually hired for these kinds of positions. As in the case of police brutality, cameras need to be recording all encounters between travelers and airport security, and extensive quality control performed. This is an issue that is tarnishing the United States's reputation everywhere. Travelers are often the elite from their respective countries and the US is digging itself into a hole with this.
There's a big opportunity for startups to provide the backend for this quality control. A hosted webapp that allows teams of inspectors to seamlessly collaborate on monitoring the quality of TSA agents from anywhere.