A federal judge has thrown out a former FBI agent’s claims that he was illegally fired after sending disparaging text messages to a colleague about President Donald Trump.