Substitute teacher claims he was banned for thanking students who stood for Pledge of Allegiance