A federal judge on Tuesday blocked the Trump administration from spending some Defense Department money to build a border wall with Mexico, the latest twist in a long-running legal battle over one of the president’s signature domestic issues and campaign priorities.