In a legal win for California, a federal judge rejected Trump’s efforts to funnel money away from permanent homeless housing.